mirror of
https://github.com/arendst/Tasmota.git
synced 2025-08-02 23:47:42 +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)
|
- OpenTherm library from v0.9.0 to v1.1.5 (#23704)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
- NeoPool fix reset to default settings
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
@ -815,14 +815,14 @@ typedef union {
|
|||||||
} NeoPoolBitfield;;
|
} NeoPoolBitfield;;
|
||||||
|
|
||||||
// Global structure containing sensor saved variables
|
// Global structure containing sensor saved variables
|
||||||
struct {
|
typedef struct {
|
||||||
uint32_t crc32;
|
uint32_t crc32;
|
||||||
uint16_t version;
|
uint16_t version;
|
||||||
NeoPoolBitfield flags;
|
NeoPoolBitfield flags;
|
||||||
uint8_t result;
|
uint8_t result;
|
||||||
uint16_t npteleperiod;
|
uint16_t npteleperiod;
|
||||||
} NeoPoolSettings;
|
} TNeoPoolSettings;
|
||||||
|
TNeoPoolSettings NeoPoolSettings;
|
||||||
|
|
||||||
#define D_NEOPOOL_NAME "NeoPool"
|
#define D_NEOPOOL_NAME "NeoPool"
|
||||||
|
|
||||||
@ -3381,6 +3381,9 @@ void NeoPoolSettingsLoad(bool erase) {
|
|||||||
NeoPoolSettings.flags.conn_stat = 1;
|
NeoPoolSettings.flags.conn_stat = 1;
|
||||||
NeoPoolSettings.result = NEOPOOL_DEFAULT_RESULT;
|
NeoPoolSettings.result = NEOPOOL_DEFAULT_RESULT;
|
||||||
NeoPoolSettings.npteleperiod = NEOPOOL_DEFAULT_NPTELEPERIOD;
|
NeoPoolSettings.npteleperiod = NEOPOOL_DEFAULT_NPTELEPERIOD;
|
||||||
|
TNeoPoolSettings NeoPoolSettingsDefaults;
|
||||||
|
memcpy(&NeoPoolSettingsDefaults, &NeoPoolSettings, sizeof(NeoPoolSettingsDefaults));
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_UFILESYS
|
#ifdef USE_UFILESYS
|
||||||
snprintf_P(filename, sizeof(filename), PSTR(TASM_FILE_SENSOR), XSNS_83);
|
snprintf_P(filename, sizeof(filename), PSTR(TASM_FILE_SENSOR), XSNS_83);
|
||||||
@ -3391,6 +3394,10 @@ void NeoPoolSettingsLoad(bool erase) {
|
|||||||
#ifdef DEBUG_TASMOTA_SENSOR
|
#ifdef DEBUG_TASMOTA_SENSOR
|
||||||
AddLog(LOG_LEVEL_DEBUG, PSTR("NEO: Settings loaded from file '%s'"), filename);
|
AddLog(LOG_LEVEL_DEBUG, PSTR("NEO: Settings loaded from file '%s'"), filename);
|
||||||
#endif // DEBUG_TASMOTA_SENSOR
|
#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 {
|
else {
|
||||||
#ifdef DEBUG_TASMOTA_SENSOR
|
#ifdef DEBUG_TASMOTA_SENSOR
|
||||||
|
Loading…
x
Reference in New Issue
Block a user