|
REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
|
Microcontroller codes (generally refered to as firmware) typically have much more global state (and Singletons) as desktop code.
Microcontroller codes (generally refered to as firmware) typically have much more global state (and Singletons) as desktop code.
This is not only due to the limited memory but also because it deals a lot with representing physical objects such as accessible discrete electronical components which shall be controlled.
Idioms
The idiomatic way of Arduino is to define and access singletons as global static variables, i.e. in some header file
Furthermore, Singletons in Arduino are typically initialized with Foo.begin(...) methods.
In contrast, this code has different ways of defining singletons, for instance static Foo& Foo::get() and Foo::get().init(...). It is an ongoing attempt to refactor them.