NanoLux (Device) 3.0
Codebase for the open-source AudioLux device.
Loading...
Searching...
No Matches
storage.h File Reference
#include <stdint.h>

Go to the source code of this file.

Classes

struct  Pattern_Data
 
struct  Strip_Data
 A structure holding strip configuration data. More...
 
struct  Config_Data
 A structure holding system configuration data. More...
 

Macros

#define NUM_SAVES   3
 The number of saved strip configs the ESP32 is able to address.
 
#define PATTERN_LIMIT   4
 The number of patterns that can run at maximum.
 

Functions

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 load_from_nvs ()
 Load all patterns from the NVS.
 
void save_config_to_nvs ()
 Saves configuration data to the NVS.
 
void verify_saves ()
 Ensures that saved settings have reasonable data.
 

Detailed Description

This file contains function headers for storage.cpp along with data structures for user data stored in NVS.

Function Documentation

◆ clear_all()

void clear_all ( )

Clears all patterns stored in NVS.

This function also clears all patterns saved in volatile storage as well.

◆ load_from_nvs()

void load_from_nvs ( )

Load all patterns from the NVS.

Ensures all loaded data is properly bounded.

◆ load_slot()

void load_slot ( int slot)

Move patterns in a slot to the main buffer.

Parameters
slotThe save slot number to load from.

◆ save_config_to_nvs()

void save_config_to_nvs ( )

Saves configuration data to the NVS.

Bounds currently-loaded settings before saving to NVS.

◆ save_to_nvs()

void save_to_nvs ( )

Saves all currently-loaded patterns to NVS.

This does not save the currently-loaded pattern.

◆ set_slot()

void set_slot ( int slot)

Saves the currently-loaded pattern to a save slot.

Parameters
slotThe save slot to overwrite.

◆ verify_saves()

void verify_saves ( )

Ensures that saved settings have reasonable data.

TODO: Is this function even needed anymore?