* Moved menu titles and option names into data structures.
* Unified select menu option code
* Also unified handling of menu selection, although main and rotator menus are still handled the old way.
* Moved struct definitions to numenu.h
* Grouped functions and variables together based on usage.
Some major refactoring has been going on.
Added simple structs of data containing info about what action to take when a menu item is selected.
Finally removed all but one call to display.display() in menu-function. There might still be more than one call to it on a frame though, since some functions still calls it internally.
Moved functions around to have a better overview of draw function. This will make it easier for me to continue with the next part, which probably will be a more generic handling of menus.
* Broke up the code into more general functions instead of duplicating code
* Made stuff const and removed variables no longer used
* Use defines for menu button values
* Changed the order or things to avoid forward declarations
* Use array lookup instead of switch-case on some menu options
* Adjust menu functionification
* Cleaned up sensor rendering
This bug would probably never happen in real life, and could be fix by holding down menu and enter buttons at startup. But a bug is a bug.
The only reason I found this bug is that the simulator didn’t initialise EEPROM to 0xff, and even after I did that it crashed, because a version of 0xffff wasn't handled.
A bug in the current NuEVI.ino does not write all default values to EEPROM on the first boot, unless menu + enter buttons are pressed. I added a workaround to the simulator that fakes that the buttons are pressed when calling the setup function.
* Press W in simulator to activate (pretty slow shit, do avoid unless compiling with optimisations)
* Tiny improvement of the EEPROM simulation.
* Fixed type typo for millis and micros
Builds a native program on MacOS that runs the NuEVI firmware compiled for x86_64.
Only input is arrow keys for menu buttons for now. Only output is console and display.
Copied some more library files into the simulation folder, and renamed the modified *.cpp files from the libraries to *_sim.cpp.