mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-19 16:56:34 +00:00
Fix LoraWan config change detection
This commit is contained in:
parent
559209ee14
commit
fe596c680d
@ -161,6 +161,16 @@ void LoraWanDeleteData(void) {
|
||||
UfsJsonSettingsDelete(key); // Use defaults
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t LoraWanGetCfgCrc(void) {
|
||||
uint32_t crc32 = 0;
|
||||
for (uint32_t n = 0; n < Lora->nodes; n++) {
|
||||
if (Lora->settings.end_node[n]->AppKey[0] > 0) { // Only save used slots
|
||||
crc32 += GetCfgCrc32((uint8_t*)Lora->settings.end_node[n], sizeof(LoraEndNode_t));
|
||||
}
|
||||
}
|
||||
return crc32;
|
||||
}
|
||||
#endif // USE_UFILESYS
|
||||
|
||||
/*********************************************************************************************/
|
||||
|
@ -176,6 +176,9 @@ void LoraSettingsSave(void) {
|
||||
// Called from FUNC_SAVE_SETTINGS every SaveData second and at restart
|
||||
#ifdef USE_UFILESYS
|
||||
uint32_t crc32 = GetCfgCrc32((uint8_t*)&Lora->settings +4, sizeof(LoraSettings_t) -4); // Skip crc32
|
||||
#ifdef USE_LORAWAN_BRIDGE
|
||||
crc32 += LoraWanGetCfgCrc();
|
||||
#endif // USE_LORAWAN_BRIDGE
|
||||
if (crc32 != Lora->settings.crc32) {
|
||||
Lora->settings.crc32 = crc32;
|
||||
if (LoraSaveData()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user