diff --git a/src/esp32_platform.cpp b/src/esp32_platform.cpp index 6f499340..46ebd204 100644 --- a/src/esp32_platform.cpp +++ b/src/esp32_platform.cpp @@ -106,8 +106,12 @@ bool Esp32Platform::sendBytesUniCast(uint32_t addr, uint16_t port, uint8_t* buff uint8_t * Esp32Platform::getEepromBuffer(uint16_t size) { - EEPROM.begin(size); - return EEPROM.getDataPtr(); + uint8_t * eepromptr = EEPROM.getDataPtr(); + if(eepromptr == nullptr) { + EEPROM.begin(KNX_FLASH_SIZE); + eepromptr = EEPROM.getDataPtr(); + } + return eepromptr; } void Esp32Platform::commitToEeprom() diff --git a/src/esp_platform.cpp b/src/esp_platform.cpp index 14a7c586..0a9e9cc8 100644 --- a/src/esp_platform.cpp +++ b/src/esp_platform.cpp @@ -106,8 +106,12 @@ bool EspPlatform::sendBytesUniCast(uint32_t addr, uint16_t port, uint8_t* buffer uint8_t * EspPlatform::getEepromBuffer(uint16_t size) { - EEPROM.begin(size); - return EEPROM.getDataPtr(); + uint8_t * eepromptr = EEPROM.getDataPtr(); + if(eepromptr == nullptr) { + EEPROM.begin(KNX_FLASH_SIZE); + eepromptr = EEPROM.getDataPtr(); + } + return eepromptr; } void EspPlatform::commitToEeprom()