Initial plan was to integrate both topics into the same chapter (and also the name was "RTOS and state machines").
I'm suggesting to separate both chapters and I chose a different name for the non-RTOS approach: Super Loop (as used in several other locations aswell). State machines are also common in an RTOS approach. And bare-metal is referring more to the HALs an drivers and not to RTOS or not (IMHO).
For explanation of the different approaches I made up a very simple example with some code in Arduino (super loop) and Zephyr (RTOS). Let me know if you find these examples suitable.
Initial plan was to integrate both topics into the same chapter (and also the name was "RTOS and state machines").
I'm suggesting to separate both chapters and I chose a different name for the non-RTOS approach: Super Loop (as used in several other locations aswell). State machines are also common in an RTOS approach. And bare-metal is referring more to the HALs an drivers and not to RTOS or not (IMHO).
For explanation of the different approaches I made up a very simple example with some code in Arduino (super loop) and Zephyr (RTOS). Let me know if you find these examples suitable.
For rendered result see here: https://learn.libre.solar/b/rtos/development/firmware_frameworks.html