mirror of
https://github.com/anklimov/lighthub
synced 2025-12-13 23:29:50 +03:00
JSON RAM optimization (update libs needed), HTTP
This commit is contained in:
@@ -248,7 +248,7 @@ NRFFlashStorage EEPROM;
|
||||
return 1;
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
#if defined(__SAM3X8E__)
|
||||
size_t flashStream::write(const uint8_t *buffer, size_t size)
|
||||
{
|
||||
@@ -258,7 +258,7 @@ NRFFlashStorage EEPROM;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
*/
|
||||
#if defined(ESP8266) || defined(ESP32)
|
||||
void flashStream::putEOF()
|
||||
{
|
||||
@@ -269,7 +269,11 @@ NRFFlashStorage EEPROM;
|
||||
|
||||
void flashStream::close()
|
||||
{
|
||||
if (openmode == 'w') putEOF();
|
||||
if (openmode == 'w')
|
||||
{
|
||||
putEOF();
|
||||
debugSerial<<F("EOF")<<endl;
|
||||
}
|
||||
#if defined(__SAM3X8E__)
|
||||
if (samBufferPos) flush();
|
||||
#endif
|
||||
|
||||
@@ -67,11 +67,11 @@ public:
|
||||
virtual void flush();
|
||||
virtual size_t write(uint8_t ch) ;
|
||||
|
||||
#if defined(__SAM3X8E__)
|
||||
virtual size_t write(const uint8_t *buffer, size_t size) override;
|
||||
#else
|
||||
//#if defined(__SAM3X8E__)
|
||||
//virtual size_t write(const uint8_t *buffer, size_t size) override;
|
||||
//#else
|
||||
using Print::write;//(const uint8_t *buffer, size_t size);
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
#if defined(ESP8266) || defined(ESP32)
|
||||
virtual void putEOF() override ;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "Streaming.h"
|
||||
#include "item.h"
|
||||
#include "bright.h"
|
||||
#include <utility/stringbuffer.h>>
|
||||
|
||||
#ifndef HSV_DISABLE
|
||||
#ifdef ADAFRUIT_LED
|
||||
@@ -1170,7 +1171,7 @@ return false;
|
||||
int cmd = txt2cmd(verb->valuestring);
|
||||
if (cmd>0)
|
||||
{
|
||||
free(verb->valuestring);
|
||||
freeString(verb->valuestring);
|
||||
verb->valueint=cmd;
|
||||
verb->type=aJson_Int;
|
||||
return verb->valueint;
|
||||
|
||||
@@ -1510,6 +1510,7 @@ int loadConfigFromEEPROM()
|
||||
#endif
|
||||
|
||||
if (sysConfStream.peek() == '{') {
|
||||
debugSerial<<F("Trying Load from EEPROM")<<endl;
|
||||
aJsonStream as = aJsonStream(&sysConfStream);
|
||||
cleanConf();
|
||||
root = aJson.parse(&as);
|
||||
|
||||
@@ -8,6 +8,11 @@
|
||||
#include "textconst.h"
|
||||
#include "main.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "streamlog.h"
|
||||
extern systemConfig sysConf;
|
||||
extern bool disableCMD;
|
||||
|
||||
#ifndef AC_Serial
|
||||
#define AC_Serial Serial3
|
||||
#endif
|
||||
@@ -237,6 +242,12 @@ debugSerial<<F("AC Init: ")<<portNum<<endl;
|
||||
if (!portNum)// && (g_APinDescription[0].ulPinType == PIO_PA8A_URXD))
|
||||
{
|
||||
pinMode(0, INPUT_PULLUP);
|
||||
#if debugSerial == Serial
|
||||
infoSerial<<F("Serial used by AC - disabling serial logging and cmd")<<
|
||||
sysConf.setSerialDebuglevel(0);
|
||||
serialDebugLevel = 0;
|
||||
disableCMD=true;
|
||||
#endif
|
||||
}
|
||||
ACSerial->begin(9600);
|
||||
item->itemArr->subtype = CST_INITIALIZED;
|
||||
|
||||
Reference in New Issue
Block a user