mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-01-30 06:03:06 +01:00
WIfiESP websock fix
This commit is contained in:
parent
c4e2146bd1
commit
59418668e2
@ -392,21 +392,19 @@ void WifiESP::loop() {
|
||||
int count=outboundRing->count();
|
||||
auto wsHeaderLen=useWebsocket? Websockets::getOutboundHeaderSize(count) : 0;
|
||||
{
|
||||
|
||||
byte buffer[wsHeaderLen+count+1]; // one extra for '\0'
|
||||
if (useWebsocket) Websockets::fillOutboundHeader(count, buffer);
|
||||
for(int i=0;i<count;i++) {
|
||||
int c = outboundRing->read();
|
||||
if (c >= 0) // Panic check, should never be false
|
||||
// websocket implementations at browser end can barf at \b
|
||||
if (websocket && (cout=='\n')) cout='\r';
|
||||
buffer[i+wsHeaderLen] = (char)c;
|
||||
else {
|
||||
DIAG(F("Ringread fail at %d"),i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// buffer filled, end with '\0' so we can use it as C string
|
||||
byte buffer[wsHeaderLen + count + 1]; // one extra for '\0'
|
||||
if (useWebsocket) Websockets::fillOutboundHeader(count, buffer);
|
||||
for (int i = 0; i < count; i++) {
|
||||
int c = outboundRing->read();
|
||||
if (!c) {
|
||||
DIAG(F("Ringread fail at %d"), i);
|
||||
break;
|
||||
}
|
||||
// websocket implementations at browser end can barf at \n
|
||||
if (useWebsocket && (c == '\n')) c = '\r';
|
||||
buffer[i + wsHeaderLen] = (char)c;
|
||||
}
|
||||
// buffer filled, end with '\0' so we can use it as C string
|
||||
buffer[wsHeaderLen+count]='\0';
|
||||
if((unsigned int)clientId <= clients.size() && clients[clientId].active(clientId)) {
|
||||
if (Diag::CMD || Diag::WITHROTTLE)
|
||||
|
27
objdump.bat
27
objdump.bat
@ -1,16 +1,17 @@
|
||||
ECHO ON
|
||||
FOR /F "delims=" %%i IN ('dir %TMP%\arduino_build_* /b /ad-h /t:c /od') DO SET a=%%i
|
||||
echo Most recent subfolder: %a% >%TMP%\OBJDUMP_%a%.txt
|
||||
SET ELF=%TMP%\%a%\CommandStation-EX.ino.elf
|
||||
FOR /F "delims=" %%i IN ('dir %TMP%\arduino\sketches\CommandStation-EX.ino.elf /s /b /o-D') DO SET ELF=%%i
|
||||
SET DUMP=%TEMP%\OBJDUMP.txt
|
||||
echo Most recent subfolder: %ELF% >%DUMP%
|
||||
|
||||
set PATH="C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\";%PATH%
|
||||
avr-objdump --private=mem-usage %ELF% >>%TMP%\OBJDUMP_%a%.txt
|
||||
ECHO ++++++++++++++++++++++++++++++++++ >>%TMP%\OBJDUMP_%a%.txt
|
||||
avr-objdump -x -C %ELF% | find ".text" | sort /+25 /R >>%TMP%\OBJDUMP_%a%.txt
|
||||
ECHO ++++++++++++++++++++++++++++++++++ >>%TMP%\OBJDUMP_%a%.txt
|
||||
avr-objdump -x -C %ELF% | find ".data" | sort /+25 /R >>%TMP%\OBJDUMP_%a%.txt
|
||||
ECHO ++++++++++++++++++++++++++++++++++ >>%TMP%\OBJDUMP_%a%.txt
|
||||
avr-objdump -x -C %ELF% | find ".bss" | sort /+25 /R >>%TMP%\OBJDUMP_%a%.txt
|
||||
ECHO ++++++++++++++++++++++++++++++++++ >>%TMP%\OBJDUMP_%a%.txt
|
||||
avr-objdump -D -S %ELF% >>%TMP%\OBJDUMP_%a%.txt
|
||||
%TMP%\OBJDUMP_%a%.txt
|
||||
avr-objdump --private=mem-usage %ELF% >>%DUMP%
|
||||
ECHO ++++++++++++++++++++++++++++++++++ >>%DUMP%
|
||||
avr-objdump -x -C %ELF% | find ".text" | sort /+25 /R >>%DUMP%
|
||||
ECHO ++++++++++++++++++++++++++++++++++ >>%DUMP%
|
||||
avr-objdump -x -C %ELF% | find ".data" | sort /+25 /R >>%DUMP%
|
||||
ECHO ++++++++++++++++++++++++++++++++++ >>%DUMP%
|
||||
avr-objdump -x -C %ELF% | find ".bss" | sort /+25 /R >>%DUMP%
|
||||
ECHO ++++++++++++++++++++++++++++++++++ >>%DUMP%
|
||||
avr-objdump -D -S %ELF% >>%DUMP%
|
||||
%DUMP%
|
||||
EXIT
|
||||
|
Loading…
Reference in New Issue
Block a user