diff --git a/src/hasp_eeprom.cpp b/src/hasp_eeprom.cpp index 1aed0979..ddc3d8d8 100644 --- a/src/hasp_eeprom.cpp +++ b/src/hasp_eeprom.cpp @@ -1,49 +1,17 @@ #include #include "EEPROM.h" -#include "hasp_debug.h" - -void eepromWrite(char addr, std::string & data); -std::string eepromRead(char addr); - void eepromSetup() { + +#if defined(STM32Fxx) + eeprom_buffer_fill(); +#endif + + // ESP8266 // Don't start at boot, only at write // EEPROM.begin(1024); // debugPrintln("EEPROM: Started Eeprom"); } void eepromLoop() -{} - -void eepromUpdate(uint16_t addr, char ch) -{ - if(EEPROM.read(addr) != ch) { - EEPROM.write(addr, ch); - } -} - -void eepromWrite(uint16_t addr, std::string & data) -{ - int count = data.length(); - for(int i = 0; i < count; i++) { - eepromUpdate(addr + i, data[i]); - } - eepromUpdate(addr + count, '\0'); - // EEPROM.commit(); -} - -std::string eepromRead(uint16_t addr) -{ - char data[1024]; // Max 1024 Bytes - int len = 0; - unsigned char k; - k = EEPROM.read(addr); - while(k != '\0' && len < 1023) // Read until null character - { - k = EEPROM.read(addr + len); - if((uint8_t(k) < 32) || (uint8_t(k) > 127)) break; // check for printable ascii, includes '\0' - data[len] = k; - len++; - } - return std::string(data); -} \ No newline at end of file +{} \ No newline at end of file