mirror of https://github.com/arendst/Tasmota.git
Fix config crc errors
Fix invalid configuration restores and decode_config.py crc error when savedata = 0 (#3918)
This commit is contained in:
parent
2252be521a
commit
3b3579f1db
|
@ -2,6 +2,7 @@
|
||||||
* Add Apparent Power and Reactive Power to Energy Monitoring devices (#251)
|
* Add Apparent Power and Reactive Power to Energy Monitoring devices (#251)
|
||||||
* Add RF Receiver control to module MagicHome to be used on Arilux LC10 (#3792)
|
* Add RF Receiver control to module MagicHome to be used on Arilux LC10 (#3792)
|
||||||
* Fix I2CScan invalid JSON error message (#3925)
|
* Fix I2CScan invalid JSON error message (#3925)
|
||||||
|
* Fix invalid configuration restores and decode_config.py crc error when savedata = 0 (#3918)
|
||||||
*
|
*
|
||||||
* 6.2.1.8 20180926
|
* 6.2.1.8 20180926
|
||||||
* Change status JSON message providing more switch and retain information
|
* Change status JSON message providing more switch and retain information
|
||||||
|
|
|
@ -1013,6 +1013,10 @@ void HandleBackupConfiguration()
|
||||||
WebServer->sendHeader(F("Content-Disposition"), attachment);
|
WebServer->sendHeader(F("Content-Disposition"), attachment);
|
||||||
|
|
||||||
WebServer->send(200, FPSTR(HDR_CTYPE_STREAM), "");
|
WebServer->send(200, FPSTR(HDR_CTYPE_STREAM), "");
|
||||||
|
|
||||||
|
uint16_t cfg_crc = Settings.cfg_crc;
|
||||||
|
Settings.cfg_crc = GetSettingsCrc(); // Calculate crc (again) as it might be wrong when savedata = 0 (#3918)
|
||||||
|
|
||||||
memcpy(settings_buffer, &Settings, sizeof(Settings));
|
memcpy(settings_buffer, &Settings, sizeof(Settings));
|
||||||
if (config_xor_on_set) {
|
if (config_xor_on_set) {
|
||||||
for (uint16_t i = 2; i < sizeof(Settings); i++) {
|
for (uint16_t i = 2; i < sizeof(Settings); i++) {
|
||||||
|
@ -1030,6 +1034,8 @@ void HandleBackupConfiguration()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SettingsBufferFree();
|
SettingsBufferFree();
|
||||||
|
|
||||||
|
Settings.cfg_crc = cfg_crc; // Restore crc in case savedata = 0 to make sure settings will be noted as changed
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleSaveSettings()
|
void HandleSaveSettings()
|
||||||
|
|
Loading…
Reference in New Issue