NanoLux (Device) 3.0
Codebase for the open-source AudioLux device.
|
Macros | |
#define | PATTERN_NAMESPACE "p" |
#define | PATTERN_KEY "k" |
#define | CONFIG_NAMESPACE "c" |
#define | CONFIG_KEY "f" |
Functions | |
void | clear_nvs () |
Clears the NVS namespace associated with saved patterns. | |
void | bound_user_data () |
Ensures all saved pattern data is properly constrained. | |
void | bound_system_settings () |
Ensures all saved user data is properly constrained. | |
void | load_slot (int slot) |
Move patterns in a slot to the main buffer. | |
void | set_slot (int slot) |
Saves the currently-loaded pattern to a save slot. | |
void | save_to_nvs () |
Saves all currently-loaded patterns to NVS. | |
void | clear_all () |
Clears all patterns stored in NVS. | |
void | save_config_to_nvs () |
Saves configuration data to the NVS. | |
void | verify_saves () |
Ensures that saved settings have reasonable data. | |
void | load_from_nvs () |
Load all patterns from the NVS. | |
Variables | |
Strip_Data | loaded_patterns |
The currently strip configuration, externed from main.ino. | |
Strip_Data | saved_patterns [NUM_SAVES] |
The array for storing saved strip configurations, externed from main.ino. | |
int | NUM_PATTERNS |
The number of patterns that can be shown, externed from globals.h. | |
Preferences | storage |
The object used to access Non-Volatile Storage. Reused between accesses. | |
Config_Data | config |
The currently-loaded device config. | |
The functions and objects in this file manage patterns saved to the device.
The AudioLux uses the ESP32's Prefrences library to interface with Non-Volatile Storage, or NVS.
void bound_system_settings | ( | ) |
Ensures all saved user data is properly constrained.
This function should not be called by itself.
void bound_user_data | ( | ) |
Ensures all saved pattern data is properly constrained.
Constrains both pattern and strip level settings. This function should not be called by itself.
void clear_all | ( | ) |
Clears all patterns stored in NVS.
This function also clears all patterns saved in volatile storage as well.
void clear_nvs | ( | ) |
Clears the NVS namespace associated with saved patterns.
This function should not be called by itself.
void load_from_nvs | ( | ) |
Load all patterns from the NVS.
Ensures all loaded data is properly bounded.
void load_slot | ( | int | slot | ) |
Move patterns in a slot to the main buffer.
slot | The save slot number to load from. |
void save_config_to_nvs | ( | ) |
Saves configuration data to the NVS.
Bounds currently-loaded settings before saving to NVS.
void save_to_nvs | ( | ) |
Saves all currently-loaded patterns to NVS.
This does not save the currently-loaded pattern.
void set_slot | ( | int | slot | ) |
Saves the currently-loaded pattern to a save slot.
slot | The save slot to overwrite. |
void verify_saves | ( | ) |
Ensures that saved settings have reasonable data.
TODO: Is this function even needed anymore?
|
extern |
The currently-loaded device config.
The current config of the device, defined in main.ino. Used to check if serial printing is allowed.
|
extern |
|
extern |