Draw the curve as well as the name of curve. Could be optimised a bit by not evaluating the curve every pixel, but something like every third pixel. Could also draw dots instead of lines if we need extra speed.
Had to change how the values where stored in RAM from singed to unsigned to be able to use the generic menu features. Also had to add the MenuEntrySub as a parameter to the menu callback functions to be able fo display and store the correct values.
Did some major cleanup now that the special case of rotator menu is gone together with all uses of the old version of the sub menu struct.
* 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.
* 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.
This change required lots of other changes to have it compile. I had to declare all variables from NuEVI.ino used by the menu as extern in a separate header file (globals.h).
Also I moved all defines from NuEVI.ino to a config.h file. I think some of these could be moved back or even moved into menu.cpp.
I declared many variables and functions in menu.cpp as static and moved them around to avoid forward declarations. For simplicity I did some forward declarations anyway.
Some varibles only used in menu.cpp was moved from NuEVI.ino instead of having them as externals.