News for hackers. Stuff that matters.
Re:How to flash an LED: writing ARM assembly for an STM32 mi... by rdc12 on Friday April 03, 2020 @06:48PM (#22774682)
The other approach to delay's (keep in mind, that there is no other process to yield the CPU too) is to use a timer (a peripheral of the micro controller).

This would take a fair bit more code to configure the timer, and setup an interrupt to handle the timer.

Re:How to flash an LED: writing ARM assembly for an STM32 mi... by MuffinFlavored on Friday April 03, 2020 @09:01PM (#22775345)
How do multiple processes usually 'share' a timer?
Re:How to flash an LED: writing ARM assembly for an STM32 mi... by rdc12 on Friday April 03, 2020 @10:00PM (#22775593)
Microcontrollers (assuming no RTOS in use), typically don't have multiple processes, they have the main thread of execution (which in the article is the entire program) and have interrupt routines that a run in response to an external event (in this case, the timer has expired).

Using the interrupt driven approach, can led to better performance both in CPU time (async communication with slower periphials etc) and battery life (sleep states).

Re:How to flash an LED: writing ARM assembly for an STM32 mi... by detaro on Friday April 03, 2020 @09:02PM (#22775353)
by either having the timer fire regularly and have run code to figure out what needs to be done now, or having code to set it to the time to the next needed interrupt