Introducing super-loops
There is one common property that all embedded systems generally share – they typically don’t have an exit point. Because of its nature, embedded code is generally expected to always be available – silently running in the background, taking care of housekeeping tasks, and ready for user input at any time. Unlike desktop environments that are meant to start and stop programs, there isn’t anything for a microcontroller to do if it exits the main() function. If this happens, it is likely that the entire device has stopped functioning. For this reason, the main() function in an embedded system is designed to never return (or if it does, it usually provides error diagnostics for debugging purposes). Unlike application programs, which are started and stopped by their host OS, most embedded MCU-based applications start at power-on and end abruptly when the system is powered off. Because of this abrupt shutdown, embedded applications typically...