Summary
The example-program showed how the timed super-loop can be implemented on our dev-board and MCU. And, although the timed super-loop is conceptually simple, the implementation is relatively complex, due to a number of factors, such as a) the ISR running concurrently with main()
, b) how the sleep function works relative to interrupts, c) the need for memory-barrier instructions, d) the potential for timing problems from the debugger, and e) the challenges related to determining how system-APIs work.
For those new to embedded-systems development, or new to the MCU and IDE, the present chapter provides a basic understanding of how the book’s example-programs were created, and how to further research the code, such as the system-API calls.
In the next chapter, we will introduce RTOS tasks and show their benefits relative to super-loop programming.