Add global/hardware settings to metadata EEPROM

This commit is contained in:
2025-07-20 12:42:25 -07:00
parent 385ce85da3
commit 16b2c2cd87
3 changed files with 35 additions and 10 deletions

View File

@ -20,7 +20,7 @@ struct AppState;
// Define the constants for the current firmware.
const char SKETCH_NAME[] = "Gravity";
const byte SKETCH_VERSION = 7;
const byte SKETCH_VERSION = 8;
// Number of available save slots.
const byte MAX_SAVE_SLOTS = 10;
@ -57,6 +57,8 @@ class StateManager {
struct Metadata {
byte version;
char sketch_name[16];
// Additional global/hardware settings
bool encoder_reversed;
};
struct ChannelState {
byte base_clock_mod_index;
@ -83,7 +85,8 @@ class StateManager {
private:
bool _isDataValid();
void _saveMetadata();
void _saveMetadata(const AppState& app);
void _loadMetadata(AppState& app);
void _saveState(const AppState& app, byte slot_index);
void _loadState(AppState& app, byte slot_index);