Added hold function and updated doc

This commit is contained in:
Julian Appel 2026-03-31 21:46:20 +02:00
parent d6ed7cb81f
commit 3e83758f05
8 changed files with 141 additions and 105 deletions

View file

@ -106,8 +106,10 @@ bool nvm_config_load(SDeviceConfig& cfg)
// ── Speichern ─────────────────────────────────────────────────────────────────
void nvm_config_save(const SDeviceConfig& cfg)
{
// Config in temporären Buffer kopieren der auf 256B (Row) aufgefüllt ist
uint8_t row[256];
// Config in temporären Buffer kopieren der auf 256B (Row) aufgefüllt ist.
// __attribute__((aligned(4))) ist zwingend: nvm_write_page castet data zu
// const uint32_t*, und unaligned 32-Bit-Zugriffe sind HardFaults auf Cortex-M0+.
uint8_t row[256] __attribute__((aligned(4)));
memset(row, 0xFF, sizeof(row));
memcpy(row, &cfg, sizeof(cfg));

View file

@ -21,7 +21,7 @@
// Gesamt genutzt: 223 Bytes (sizeof SDeviceConfig mit packed SAction)
#define NVM_CONFIG_MAGIC 0x56503202UL
#define NVM_CONFIG_VERSION 2 // Version 2: led_anim + led_period_ms hinzugefügt
#define NVM_CONFIG_VERSION 2 // Version 2
// Encoder-Aktions-Indizes (in SDeviceConfig.enc_actions[])
// Reihenfolge: [enc][0]=SW, [enc][1]=CW, [enc][2]=CCW