From 95cf9df7fc3d509060742d888464230d2fca7b14 Mon Sep 17 00:00:00 2001 From: OutOfSync1 Date: Tue, 4 May 2021 16:17:27 +0200 Subject: [PATCH] fix userdata saverestore (#133) (#135) * set saveSize at compile time * make sure USERDATA_SAVE_SIZE is set to valid value --- src/knx_facade.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/knx_facade.h b/src/knx_facade.h index e0cecab..c23bdd2 100644 --- a/src/knx_facade.h +++ b/src/knx_facade.h @@ -8,6 +8,10 @@ #include "knx/bau2920.h" #include "knx/bau57B0.h" +#ifndef USERDATA_SAVE_SIZE +#define USERDATA_SAVE_SIZE 0 +#endif + #ifdef ARDUINO_ARCH_SAMD #include "samd_platform.h" #ifndef KNX_NO_AUTOMATIC_GLOBAL_INSTANCE @@ -341,7 +345,7 @@ template class KnxFacade : private SaveRestore RestoreCallback _restoreCallback = 0; volatile bool _toggleProgMode = false; bool _progLedState = false; - uint16_t _saveSize = 0; + uint16_t _saveSize = USERDATA_SAVE_SIZE; IsrFunctionPtr _progButtonISRFuncPtr = 0; uint8_t* save(uint8_t* buffer)