gedankenexperimenter / Kaleidoscope

Firmware for the Keyboardio Model 01 and other keyboards with AVR or ARM MCUs.
http://keyboard.io
GNU General Public License v3.0
0 stars 1 forks source link

Singletons & global variables #9

Open gedankenexperimenter opened 6 years ago

gedankenexperimenter commented 6 years ago

I had an idea this morning about using a singleton for the Controller (i.e. Main, i.e. Kaleidoscope) class, defined in the Controller.cpp file, and having friend functions (or static class functions) provide the interface, as inline wrappers around the singleton calls. This might save some trouble with either having a plain global object, but it might also introduce unwanted function call overhead; I'm not sure yet.