fix userdata saverestore (#133)

* * fix for save/restore of userdata

* change declaration of restore() in knx_facade.h to "const uint8_t* restore(const uint8_t* buffer)" to avoid calling default implementation in save_restore.h

* change typedefs to separate SaveCallback and RestoreCallback

* fix BME60 example, knx.setRestoreCallback() needs to use const uint8_t* as well

* fix commitToEeprom for ESP32

* trigger dirty flag for ESP32 to make sure data is committed
This commit is contained in:
OutOfSync1
2021-04-14 23:46:03 +02:00
committed by GitHub
parent 1343ed0b7d
commit 14162fb1a4
3 changed files with 10 additions and 8 deletions

View File

@@ -25,7 +25,7 @@
void checkIaqSensorStatus(void);
void errLeds(void);
uint8_t* saveBme680State(uint8_t* buffer);
uint8_t* loadBme680State(uint8_t* buffer);
const uint8_t* loadBme680State(const uint8_t* buffer);
void triggerCallback(GroupObject& go);
void updateState();
@@ -214,7 +214,7 @@ void errLeds(void)
delay(100);
}
uint8_t* loadBme680State(uint8_t* buffer)
const uint8_t* loadBme680State(const uint8_t* buffer)
{
// Existing state in EEPROM
Serial.println("Reading state from EEPROM");