Berry fix wrong color in console

This commit is contained in:
Stephan Hadinger 2022-02-16 22:03:58 +01:00
parent 06c33d34ef
commit 6928615eb7
3 changed files with 8 additions and 5 deletions

View File

@ -96,4 +96,7 @@ public:
}; };
BerrySupport berry; BerrySupport berry;
// multi-purpose serial logging
extern "C" void serial_debug(const char * berry_buf, ...);
#endif // USE_BERRY #endif // USE_BERRY

View File

@ -24,7 +24,7 @@
#include <Wire.h> #include <Wire.h>
const uint32_t BERRY_MAX_LOGS = 16; // max number of print output recorded when outside of REPL, used to avoid infinite grow of logs const uint32_t BERRY_MAX_LOGS = 16; // max number of print output recorded when outside of REPL, used to avoid infinite grow of logs
const uint32_t BERRY_MAX_REPL_LOGS = 1024; // max number of print output recorded when inside REPL const uint32_t BERRY_MAX_REPL_LOGS = 50; // max number of print output recorded when inside REPL
// /*********************************************************************************************\ // /*********************************************************************************************\
// * Return C callback from index // * Return C callback from index
@ -601,7 +601,7 @@ void berry_log(const char * berry_buf) {
if (berry.log.log.length() == 0) { if (berry.log.log.length() == 0) {
pre_delimiter = BERRY_CONSOLE_CMD_DELIMITER; pre_delimiter = BERRY_CONSOLE_CMD_DELIMITER;
} }
if (berry.log.log.length() >= BERRY_MAX_LOGS) { if (berry.log.log.length() >= max_logs) {
berry.log.log.remove(berry.log.log.head()); berry.log.log.remove(berry.log.log.head());
} }
berry.log.addString(berry_buf, pre_delimiter, "\n"); berry.log.addString(berry_buf, pre_delimiter, "\n");

View File

@ -492,15 +492,15 @@ const char HTTP_SCRIPT_BERRY_CONSOLE[] PROGMEM =
"x.onreadystatechange=function(){" "x.onreadystatechange=function(){"
"if(x.readyState==4&&x.status==200){" "if(x.readyState==4&&x.status==200){"
"var d,t1;" "var d,t1;"
"d=x.responseText.split(/" BERRY_CONSOLE_CMD_DELIMITER "/);" // Field separator "d=x.responseText.split(/" BERRY_CONSOLE_CMD_DELIMITER "/,2);" // Field separator
"var d1=d.shift();" "var d1=d.length>1?d[0]:null;"
"if(d1){" "if(d1){"
"t1=document.createElement('div');" "t1=document.createElement('div');"
"t1.classList.add('br1');" "t1.classList.add('br1');"
"t1.innerText=d1;" "t1.innerText=d1;"
"t.appendChild(t1);" "t.appendChild(t1);"
"}" "}"
"d1=d.shift();" "d1=d.length>1?d[1]:d[0];"
"if(d1){" "if(d1){"
"t1=document.createElement('div');" "t1=document.createElement('div');"
"t1.classList.add('br2');" "t1.classList.add('br2');"