mirror of
https://github.com/anklimov/lighthub
synced 2025-12-06 03:39:49 +03:00
JSON RAM optimization (update libs needed), HTTP
This commit is contained in:
Binary file not shown.
BIN
compiled/Mega2560-optiboot/firmware.elf
Normal file
BIN
compiled/Mega2560-optiboot/firmware.elf
Normal file
Binary file not shown.
Binary file not shown.
@@ -59,8 +59,8 @@ PING -n %WAIT_ERASED% 127.0.0.1>NUL
|
||||
|
||||
REM Execute bossac.exe
|
||||
ECHO Execute bossac with command line:
|
||||
ECHO "%BOSSACPATH%" -i -d --port=%COMPORT% -U false -e -w -v -b "%BINFILE%" -R
|
||||
START /WAIT "" "%BOSSACPATH%" -i --port=%COMPORT% -U false -e -w -v -b "%BINFILE%" -R
|
||||
"%BOSSACPATH%" -i --port=%COMPORT% -U false -e -u -w -v -b "%BINFILE%" -R
|
||||
REM START /WAIT "" "%BOSSACPATH%" -i --port=%COMPORT% -U false -e -w -v -b "%BINFILE%" -R
|
||||
|
||||
GOTO end
|
||||
|
||||
|
||||
91
compiled/lighthub21/uploadNative.bat
Normal file
91
compiled/lighthub21/uploadNative.bat
Normal file
@@ -0,0 +1,91 @@
|
||||
@ECHO off
|
||||
|
||||
REM Wait X second for memory on Arduino Due is erased.
|
||||
SET WAIT_ERASED=4
|
||||
|
||||
ECHO ------ External tool BossacArduinoDue started ------
|
||||
|
||||
REM number of command line arguments ok?
|
||||
REM IF [%1]==[] GOTO error_args
|
||||
REM IF [%2]==[] GOTO error_args
|
||||
|
||||
REM set command line arguments
|
||||
SET BOSSACPATH=..\tools\win\tool-bossac\bossac.exe
|
||||
SET BINFILE=firmware.bin
|
||||
|
||||
REM parse command line arguments
|
||||
SET BOSSACPATH=%BOSSACPATH:"=%
|
||||
SET BINFILE=%BINFILE:"=%
|
||||
|
||||
REM workeround for bug in Atmel Studio 6.0.1996 Service Pack 2
|
||||
SET BINFILE=%BINFILE:\\=\%
|
||||
SET BINFILE=%BINFILE:.cproj=%
|
||||
|
||||
REM bossac path exist?
|
||||
IF NOT EXIST "%BOSSACPATH%" GOTO error_arg1
|
||||
|
||||
REM bin file exist?
|
||||
IF NOT EXIST "%BINFILE%" GOTO error_binfile
|
||||
|
||||
REM fetch DeviceID of Arduino Due Programming Port from WMI Service
|
||||
FOR /f "tokens=* skip=1" %%a IN ('wmic PATH Win32_SerialPort Where "Caption LIKE '%%BOSSA%%'" get DeviceID') DO (
|
||||
SET COMX=%%a
|
||||
GOTO exit1
|
||||
)
|
||||
|
||||
REM Arduino Due Programming Port not exist
|
||||
GOTO error_comport
|
||||
|
||||
:exit1
|
||||
|
||||
REM remove blank
|
||||
SET COMPORT=%COMX: =%
|
||||
|
||||
REM report in Atmel Studio 6.0 IDE output window
|
||||
ECHO BossacPath=%BOSSACPATH%
|
||||
ECHO BinFile=%BINFILE%
|
||||
ECHO Arduino Due Programming Port is detected as %COMPORT%.
|
||||
|
||||
REM The bossac bootloader only runs if the memory on Arduino Due is erased.
|
||||
REM The Arduino IDE does this by opening and closing the COM port at 1200 baud.
|
||||
REM This causes the Due to execute a soft erase command.
|
||||
ECHO Forcing reset using 1200bps open/close on port
|
||||
ECHO MODE %COMPORT%:1200,N,8,1
|
||||
MODE %COMPORT%:1200,N,8,1
|
||||
|
||||
REM Wait X second for memory on Arduino Due is erased.
|
||||
ECHO Wait for memory on Arduino Due is erased...
|
||||
PING -n %WAIT_ERASED% 127.0.0.1>NUL
|
||||
|
||||
REM Execute bossac.exe
|
||||
ECHO Execute bossac with command line:
|
||||
|
||||
"%BOSSACPATH%" -i --port=%COMPORT% -u -e -w -v -b "%BINFILE%" -R
|
||||
REM START /WAIT "" "%BOSSACPATH%" -i --port=%COMPORT% -u -e -w -v -b "%BINFILE%" -R
|
||||
|
||||
GOTO end
|
||||
|
||||
:error_args
|
||||
ECHO Error: wrong number of command line arguments passed!
|
||||
GOTO end
|
||||
|
||||
:error_arg1
|
||||
ECHO Error: command line argument 1 - path to bossac.exe not exist! - "C:\Program Files (x86)\arduino-1.5.2\hardware\tools\bossac.exe"
|
||||
ECHO Error: command line argument 1 - argument passed = %1
|
||||
GOTO end
|
||||
|
||||
:error_arg2
|
||||
ECHO Error: command line argument 2 - path to bin file not exist! - use $(OutputDirectory)\$(OutputFileName).bin
|
||||
ECHO Error: command line argument 2 - argument passed = %1
|
||||
GOTO end
|
||||
|
||||
:error_binfile
|
||||
ECHO Error: bin file "%BINFILE%" not exist!
|
||||
GOTO end
|
||||
|
||||
:error_comport
|
||||
ECHO Error: Arduino Due Programming Port not found!
|
||||
|
||||
:end
|
||||
|
||||
ECHO ======================== Done ========================
|
||||
BIN
docs/html/search/firmware.bin
Normal file
BIN
docs/html/search/firmware.bin
Normal file
Binary file not shown.
@@ -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