Menu system
toern_menu.ino implements the on-device settings UI entered via the MENU mode.
Structure
Top-level pages fan into submenus flagged by booleans such as:
inLookSubmenuinRecsSubmenuinMidiSubmenuinVolSubmenuinEtcSubmenu
Each has a current*Page index. Exiting restores draw vs single via menuEnteredFromSingleMode.
Notable ETC behavior
Menu → ETC → SD toggles the USB serial SD server (toern_sd_serial.ino). loop() watches inEtcSubmenu + the active menu setting id and calls sdSerialServerSetActive / sdSerialServerPoll.
Settings backup
Menu changes can mark settings dirty (markSettingsBackupDirty) and later flush via serviceSettingsBackup() from loop() — keeping EEPROM/SD writes off the audio ISR path.
Adding a menu item
- Allocate a setting id / page slot in the menu tables.
- Handle encoder adjust + button confirm in the menu update path.
- Persist if needed (EEPROM and/or settings file).
- Ensure drawing covers the new label on the matrix font/icon set.