nit pick fixes and docs
This commit is contained in:
@ -42,7 +42,7 @@ static const int CLOCK_MOD_PULSES[MOD_CHOICE_SIZE] PROGMEM = {
|
||||
192, 288, 384, 480, 576, 672, 768, 864, 960, 1056, 1152, 1536, 2304, 3072, 6144, 12288
|
||||
};
|
||||
|
||||
static const byte DEFAULT_CLOCK_MOD = 8; // x1 or 96 PPQN.
|
||||
static const byte DEFAULT_CLOCK_MOD_INDEX = 8; // x1 or 96 PPQN.
|
||||
|
||||
class Channel {
|
||||
public:
|
||||
@ -52,7 +52,7 @@ class Channel {
|
||||
|
||||
void Init() {
|
||||
// Reset base values to their defaults
|
||||
base_clock_mod_index = DEFAULT_CLOCK_MOD;
|
||||
base_clock_mod_index = DEFAULT_CLOCK_MOD_INDEX;
|
||||
base_probability = 100;
|
||||
base_duty_cycle = 50;
|
||||
base_offset = 0;
|
||||
|
||||
@ -18,6 +18,7 @@ bool StateManager::initialize(AppState& app) {
|
||||
// Initialize eeprom and save default patter to all save slots.
|
||||
reset(app);
|
||||
_saveMetadata();
|
||||
// MAX_SAVE_SLOTS slot is reserved for transient state.
|
||||
for (int i = 0; i <= MAX_SAVE_SLOTS; i++) {
|
||||
app.selected_save_slot = i;
|
||||
_saveState(app, i);
|
||||
|
||||
@ -19,6 +19,11 @@ static const unsigned long SAVE_DELAY_MS = 2000;
|
||||
|
||||
/**
|
||||
* @brief Manages saving and loading of the application state to and from EEPROM.
|
||||
* The number of user slots is defined by MAX_SAVE_SLOTS, and one additional slot
|
||||
* is reseved for transient state to persist state between power cycles before
|
||||
* state is explicitly saved to a user slot. Metadata is stored in the beginning
|
||||
* of the memory space which stores firmware version information to validate that
|
||||
* the data can be loaded into the current version of AppState.
|
||||
*/
|
||||
class StateManager {
|
||||
public:
|
||||
@ -28,7 +33,7 @@ class StateManager {
|
||||
bool initialize(AppState& app);
|
||||
// Load data from specified slot.
|
||||
bool loadData(AppState& app, byte slot_index);
|
||||
// Save data to slot defined by app.
|
||||
// Save data to specified slot.
|
||||
void saveData(const AppState& app);
|
||||
// Reset AppState instance back to default values.
|
||||
void reset(AppState& app);
|
||||
|
||||
Reference in New Issue
Block a user