mirror of
https://github.com/thelsing/knx.git
synced 2024-10-20 20:07:45 +02:00
Fix callback sequence (#153)
Save-/restore callbacks need to be defined before knx.readMemory() to ensure the restore callback is called.
This commit is contained in:
parent
616599cf8b
commit
87edd3dfe0
@ -53,6 +53,10 @@ void setup(void)
|
|||||||
wifiManager.autoConnect("knx-bme680");
|
wifiManager.autoConnect("knx-bme680");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// set save and restore callbacks
|
||||||
|
knx.setSaveCallback(saveBme680State);
|
||||||
|
knx.setRestoreCallback(loadBme680State);
|
||||||
|
|
||||||
// read adress table, association table, groupobject table and parameters from eeprom
|
// read adress table, association table, groupobject table and parameters from eeprom
|
||||||
knx.readMemory();
|
knx.readMemory();
|
||||||
|
|
||||||
@ -60,7 +64,6 @@ void setup(void)
|
|||||||
if(knx.configured())
|
if(knx.configured())
|
||||||
goTriggerSample.callback(triggerCallback);
|
goTriggerSample.callback(triggerCallback);
|
||||||
|
|
||||||
|
|
||||||
// Configure Wire pins before this call if needed.
|
// Configure Wire pins before this call if needed.
|
||||||
Wire.begin();
|
Wire.begin();
|
||||||
// depends on sensor board. Try BME680_I2C_ADDR_PRIMARY if it doen't work.
|
// depends on sensor board. Try BME680_I2C_ADDR_PRIMARY if it doen't work.
|
||||||
@ -87,9 +90,6 @@ void setup(void)
|
|||||||
BSEC_OUTPUT_GAS_PERCENTAGE
|
BSEC_OUTPUT_GAS_PERCENTAGE
|
||||||
};
|
};
|
||||||
|
|
||||||
knx.setSaveCallback(saveBme680State);
|
|
||||||
knx.setRestoreCallback(loadBme680State);
|
|
||||||
|
|
||||||
if (knx.configured())
|
if (knx.configured())
|
||||||
{
|
{
|
||||||
cyclSend = knx.paramInt(0);
|
cyclSend = knx.paramInt(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user