.. include:: RTOS/Zephyr Application Programming (2026-10-14 - 2026-10-15) ============================================================= .. topic:: Course Info * **Course Material**: :doc:`/trainings/material/soup/linux/why/index` * **Begin times**: 2026-10-14, 9:00 .. contents:: :local: Main Course: Away From Interrupts, Into RTOS -------------------------------------------- (From :doc:`/trainings/material/soup/linux/why/index`) Interrupt Madness ................. * :doc:`/trainings/material/soup/linux/why/overview/index` * :doc:`/trainings/material/soup/linux/why/temperature-controller/thing-definition/index` * :doc:`Excursion: WhyOS Interrupt Handling ` * :doc:`/trainings/material/soup/linux/why/temperature-controller/bare-metal-initial/index` * :doc:`/trainings/material/soup/linux/why/temperature-controller/bare-metal-spinlock/index` * :doc:`Excursion: More About Spinlocks ` * :doc:`/trainings/material/soup/linux/why/temperature-controller/can-jf0815-hw/index` * :doc:`/trainings/material/soup/linux/why/temperature-controller/bare-metal-can/index` Summary ....... * :doc:`/trainings/material/soup/linux/why/temperature-controller/bare-metal-summary/index` Basic OS Building Blocks ........................ * :doc:`/trainings/material/soup/linux/why/threads/index` * :doc:`/trainings/material/soup/linux/why/semaphore/index` * :doc:`/trainings/material/soup/linux/why/messagequeue/index` Getting Rid Of Long-Running Interrupt Service Routines ...................................................... Plan: create three threads (yes, this is three too many), and only wake them from ISRs. Talk about priorities, and priority inversion. * :doc:`/trainings/material/soup/linux/why/temperature-controller/can-jf0815-blocking/index` * :doc:`/trainings/material/soup/linux/why/temperature-controller/os-can-thread/index` * :doc:`/trainings/material/soup/linux/why/temperature-controller/os-timer-tick-thread/index` * :doc:`/trainings/material/soup/linux/why/temperature-controller/os-sensor-burning-thread/index` * :doc:`/trainings/material/soup/linux/why/temperature-controller/os-operator-button-thread/index` Advanced: Event Multiplexing ............................ * :doc:`/trainings/material/soup/linux/why/temperature-controller/os-eventloop/index` Notifier Hell ------------- Trying to answer the question "How can I broadcast a new value across my entire program?". Sketched a "Broadcaster" thing in the middle where you could set values, and where people could register callbacks. The ``Broadcaster`` has a major shortcoming: the registered callbacks are invoked while holding the internal mutex. **A severe bug!** * A callback might be so badly implemented as to register another callback when invoked. * Fortunately, in WhyOS (and Zephyr) mutexes are recursive, and a deadlock is avoided. * Unfortunately though, we modify the callback list while traversing it. (To see the relevant lines, search the code for ``(WAAH)`` markers.) |longrightarrow| re-entering something is bad, generally! .. literalinclude:: code/notifier-hell.cpp :caption: :download:`code/notifier-hell.cpp` :language: c++ C++ Memory Model ---------------- * :doc:`/trainings/material/soup/cxx/cxx11/multithreading/memory-model/index`