mirror of
https://github.com/arendst/Tasmota.git
synced 2025-08-01 23:17:43 +00:00
NeoPool fix reset to default settings (#23734)
This commit is contained in:
parent
bbc299fe54
commit
86c204e1a1
@ -20,6 +20,7 @@ All notable changes to this project will be documented in this file.
|
||||
- OpenTherm library from v0.9.0 to v1.1.5 (#23704)
|
||||
|
||||
### Fixed
|
||||
- NeoPool fix reset to default settings
|
||||
|
||||
### Removed
|
||||
|
||||
|
@ -815,14 +815,14 @@ typedef union {
|
||||
} NeoPoolBitfield;;
|
||||
|
||||
// Global structure containing sensor saved variables
|
||||
struct {
|
||||
typedef struct {
|
||||
uint32_t crc32;
|
||||
uint16_t version;
|
||||
NeoPoolBitfield flags;
|
||||
uint8_t result;
|
||||
uint16_t npteleperiod;
|
||||
} NeoPoolSettings;
|
||||
|
||||
} TNeoPoolSettings;
|
||||
TNeoPoolSettings NeoPoolSettings;
|
||||
|
||||
#define D_NEOPOOL_NAME "NeoPool"
|
||||
|
||||
@ -3381,6 +3381,9 @@ void NeoPoolSettingsLoad(bool erase) {
|
||||
NeoPoolSettings.flags.conn_stat = 1;
|
||||
NeoPoolSettings.result = NEOPOOL_DEFAULT_RESULT;
|
||||
NeoPoolSettings.npteleperiod = NEOPOOL_DEFAULT_NPTELEPERIOD;
|
||||
TNeoPoolSettings NeoPoolSettingsDefaults;
|
||||
memcpy(&NeoPoolSettingsDefaults, &NeoPoolSettings, sizeof(NeoPoolSettingsDefaults));
|
||||
|
||||
|
||||
#ifdef USE_UFILESYS
|
||||
snprintf_P(filename, sizeof(filename), PSTR(TASM_FILE_SENSOR), XSNS_83);
|
||||
@ -3391,6 +3394,10 @@ void NeoPoolSettingsLoad(bool erase) {
|
||||
#ifdef DEBUG_TASMOTA_SENSOR
|
||||
AddLog(LOG_LEVEL_DEBUG, PSTR("NEO: Settings loaded from file '%s'"), filename);
|
||||
#endif // DEBUG_TASMOTA_SENSOR
|
||||
if (NeoPoolSettings.crc32 != GetCfgCrc32((uint8_t*)&NeoPoolSettings +4, sizeof(NeoPoolSettings) -4)) {
|
||||
AddLog(LOG_LEVEL_INFO, PSTR("NEO: Settings CRC error, reset to defaults"));
|
||||
memcpy(&NeoPoolSettings, &NeoPoolSettingsDefaults, sizeof(NeoPoolSettings));
|
||||
}
|
||||
}
|
||||
else {
|
||||
#ifdef DEBUG_TASMOTA_SENSOR
|
||||
|
Loading…
x
Reference in New Issue
Block a user