BrianSidebotham / arm-tutorial-rpi

Raspberry-Pi Bare Metal Programming in C Tutorial
https://www.valvers.com/open-software/raspberry-pi/bare-metal-programming-in-c-part-1/
MIT License
585 stars 177 forks source link

Can I use a sub-function to control led in bare metal code? #44

Closed JIAZM closed 3 years ago

JIAZM commented 3 years ago

Hello ! I followed the instructions in the document BMC Part 1-Getting Started to write a bare metal code to apply to my Raspi zero w. When I write all code in the main function, everything is normal, but when I control the LED as a sub-function and call the form in main(), after the board is powered on, the LED only lights up once and then goes out forever. At present, I have not found any grammatical problems in my program. I really want to know the reasons for this phenomenon. If you can answer me, I would be very grateful!

BrianSidebotham commented 3 years ago

@JIAZM Yes you can - but not at the end of part-1. You need to progress further until the end of part-2 and then you should find you have enough of a c-environment set up in order to expand a bit further.