[HAL] Fixed persistent storage on Sparkfun Apollo (#848)

pull/860/head
jgromes 2023-10-15 08:48:37 +02:00
rodzic 0d43891070
commit 4e0ed033db
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -106,6 +106,8 @@ void ArduinoHal::readPersistentStorage(uint32_t addr, uint8_t* buff, size_t len)
#if !defined(RADIOLIB_EEPROM_UNSUPPORTED)
#if defined(RADIOLIB_ESP32)
EEPROM.begin(RADIOLIB_HAL_PERSISTENT_STORAGE_SIZE);
#elif defined(ARDUINO_ARCH_APOLLO3)
EEPROM.init();
#endif
for(size_t i = 0; i < len; i++) {
buff[i] = EEPROM.read(addr + i);
@ -120,6 +122,8 @@ void ArduinoHal::writePersistentStorage(uint32_t addr, uint8_t* buff, size_t len
#if !defined(RADIOLIB_EEPROM_UNSUPPORTED)
#if defined(RADIOLIB_ESP32)
EEPROM.begin(RADIOLIB_HAL_PERSISTENT_STORAGE_SIZE);
#elif defined(ARDUINO_ARCH_APOLLO3)
EEPROM.init();
#endif
for(size_t i = 0; i < len; i++) {
EEPROM.write(addr + i, buff[i]);