mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
Fix issue with Esp8266/Esp32 platform reinitializing EEPROM multiple times causing it to forget staged EEPROM changes (#196)
This commit is contained in:
parent
9c620a013d
commit
b0153de97f
@ -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()
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user