mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-24 11:46:34 +00:00
Eeprtom testing
This commit is contained in:
parent
d90b577252
commit
8f71db923e
14
src/hasp.cpp
14
src/hasp.cpp
@ -3,8 +3,9 @@
|
||||
*********************/
|
||||
#include "hasp_conf.h"
|
||||
#include <Arduino.h>
|
||||
#include "ArduinoJson.h"
|
||||
#include "ArduinoLog.h"
|
||||
#include "ArduinoJson.h"
|
||||
#include "StreamUtils.h"
|
||||
|
||||
#include "lvgl.h"
|
||||
#include "lv_conf.h"
|
||||
@ -24,6 +25,8 @@
|
||||
#include "hasp_attribute.h"
|
||||
#include "hasp.h"
|
||||
|
||||
#include "EEPROM.h"
|
||||
|
||||
//#if LV_USE_HASP
|
||||
|
||||
/*********************
|
||||
@ -955,6 +958,15 @@ void haspLoadPage(const char * pages)
|
||||
file.close();
|
||||
|
||||
Log.notice(F("HASP: File %s loaded"), pages);
|
||||
#else
|
||||
|
||||
#if HASP_USE_EEPROM > 0
|
||||
Log.notice(F("HASP: Loading jsonl from EEPROM..."));
|
||||
EepromStream eepromStream(4096, 1024);
|
||||
dispatchJsonl(eepromStream);
|
||||
Log.notice(F("HASP: Loaded jsonl from EEPROM"));
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,12 @@ void eepromSetup()
|
||||
|
||||
#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\"}";
|
||||
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
|
||||
|
||||
// ESP8266 // Don't start at boot, only at write
|
||||
|
Loading…
x
Reference in New Issue
Block a user