forked from jappel/VersaMCU
Harden firmware state and transfer handling
This commit is contained in:
parent
50dbf8fbee
commit
ce5db617a1
27 changed files with 558 additions and 231 deletions
|
|
@ -61,13 +61,22 @@ struct __attribute__((packed)) SDeviceConfig
|
|||
// Gesamt: 32 + 708 = 740B
|
||||
};
|
||||
|
||||
static_assert(sizeof(SAction) == 3, "SAction binary layout changed");
|
||||
static_assert(sizeof(SDeviceProfile) == 236, "SDeviceProfile binary layout changed");
|
||||
static_assert(sizeof(SDeviceConfig) == 740, "SDeviceConfig binary layout changed");
|
||||
|
||||
// Standardwerte wenn keine gültige Config im NVM
|
||||
void nvm_config_defaults(SDeviceConfig& cfg);
|
||||
|
||||
// Vollständige Prüfung des persistenten/seriellen Binärvertrags inklusive CRC,
|
||||
// Enum-Bereichen, Action-Nutzdaten und animationsspezifischen Mindestwerten.
|
||||
bool nvm_config_validate(const SDeviceConfig& cfg);
|
||||
|
||||
// Config aus NVM lesen. Gibt false zurück wenn Magic/CRC/Version ungültig → Defaults geladen.
|
||||
bool nvm_config_load(SDeviceConfig& cfg);
|
||||
|
||||
// Config in NVM schreiben (löscht 3 Rows, schreibt 12 Pages).
|
||||
// Config in NVM schreiben (CRC wird intern neu berechnet; löscht 3 Rows,
|
||||
// schreibt 12 Pages).
|
||||
// Gibt false zurück wenn eine NVM-Operation nicht rechtzeitig fertig wird (Board hängt nicht).
|
||||
bool nvm_config_save(const SDeviceConfig& cfg);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue