From 874456b458333ba110d2a73dd862902b803859d2 Mon Sep 17 00:00:00 2001 From: fvanroie <15969459+fvanroie@users.noreply.github.com> Date: Tue, 16 Feb 2021 17:17:07 +0100 Subject: [PATCH] Xplatfotm changes --- src/hasp_eeprom.cpp | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/hasp_eeprom.cpp b/src/hasp_eeprom.cpp index 7faa5527..80a1a27d 100644 --- a/src/hasp_eeprom.cpp +++ b/src/hasp_eeprom.cpp @@ -1,21 +1,29 @@ /* MIT License - Copyright (c) 2020 Francis Van Roie For full license information read the LICENSE file in the project folder */ -#include -#include "EEPROM.h" +#include "hasp_conf.h" // load first + +#if HASP_USE_EEPROM > 0 + + #ifdef ARDUINO + #include "Arduino.h" + #endif + + #include "EEPROM.h" void eepromSetup() { -#if defined(STM32Fxx) + #if defined(STM32Fxx) eeprom_buffer_fill(); - char buffer[] = "{\"objid\":10,\"id\":1,\"page\":0,\"x\":10,\"y\":45,\"w\":220,\"h\":55,\"toggle\":\"TRUE\",\"txt\":\"Toggle Me\"}"; + char buffer[] = "{\"objid\":10,\"id\":1,\"page\":0,\"x\":10,\"y\":45,\"w\":220,\"h\":55,\"toggle\":\"TRUE\"," + "\"txt\":\"Toggle Me\"}"; uint size = strlen(buffer); uint16_t i; - for(i = 0; i < size; i++) eeprom_buffered_write_byte(i+4096, buffer[i]); - eeprom_buffered_write_byte(i+4096, 0); - // eeprom_buffer_flush(); -#endif + for(i = 0; i < size; i++) eeprom_buffered_write_byte(i + 4096, buffer[i]); + eeprom_buffered_write_byte(i + 4096, 0); + // eeprom_buffer_flush(); + #endif // ESP8266 // Don't start at boot, only at write // EEPROM.begin(1024); @@ -23,4 +31,6 @@ void eepromSetup() } void eepromLoop() -{} \ No newline at end of file +{} + +#endif \ No newline at end of file