diff --git a/CMakeLists.txt b/CMakeLists.txt index e5d0fc7..de126e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,8 +144,7 @@ add_definitions( -DFLAG_GZIP=2 -DADMIN_PASSWORD="asdf" -DGIT_HASH="blabla" - -DDEBUG_ANSI=1 - -DDEBUG_ANSI_NOIMPL=1 + -DDEBUG_HEAP=1 -DESPFS_HEATSHRINK) add_executable(esp_vt100_firmware ${SOURCE_FILES}) diff --git a/Makefile b/Makefile index 57c62bd..1c3c4a7 100644 --- a/Makefile +++ b/Makefile @@ -67,14 +67,12 @@ CFLAGS = -Os -ggdb -std=gnu99 -Werror -Wpointer-arith -Wundef -Wall -Wl,-EL -fn -nostdlib -mlongcalls -mtext-section-literals -D__ets__ -DICACHE_FLASH \ -Wno-address -Wno-unused -CFLAGS += -DHTTPD_MAX_BACKLOG_SIZE=10240 CFLAGS += -DGIT_HASH='"$(shell git rev-parse --short HEAD)"' CFLAGS += -DADMIN_PASSWORD=$(ADMIN_PASSWORD) -# Debug logging -CFLAGS += -DDEBUG_ANSI=1 -CFLAGS += -DDEBUG_ANSI_NOIMPL=1 -CFLAGS += -DDEBUG_INPUT=1 +ifdef GLOBAL_CFLAGS +CFLAGS += $(GLOBAL_CFLAGS) +endif # linker flags used to generate the main object file LDFLAGS = -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static diff --git a/esphttpdconfig.mk b/esphttpdconfig.mk index edc6980..e29783b 100644 --- a/esphttpdconfig.mk +++ b/esphttpdconfig.mk @@ -40,3 +40,15 @@ ESP_SPI_FLASH_SIZE_K = 1024 # Admin password, used to store settings to flash as defaults ADMIN_PASSWORD = "19738426" + +GLOBAL_CFLAGS = \ + -DDEBUG_ROUTER=0 \ + -DDEBUG_CAPTDNS=0 \ + -DDEBUG_HTTP=1 \ + -DDEBUG_ESPFS=0 \ + -DDEBUG_WS=0 \ + -DDEBUG_ANSI=0 \ + -DDEBUG_ANSI_NOIMPL=0 \ + -DHTTPD_MAX_BACKLOG_SIZE=8192 \ + -DDEBUG_INPUT=0 \ + -DDEBUG_HEAP=1 \ diff --git a/html_orig/js/app.js b/html_orig/js/app.js index 6e819a2..4eb4b82 100644 --- a/html_orig/js/app.js +++ b/html_orig/js/app.js @@ -2003,10 +2003,10 @@ var Input = (function() { 'down': ca('\x1bOB', '\x1b[B'), 'right': ca('\x1bOC', '\x1b[C'), 'left': ca('\x1bOD', '\x1b[D'), - 'home': fa('\x1bOH', '\x1b[1~'), + 'home': ca('\x1bOH', fa('\x1b[H', '\x1b[1~')), 'insert': '\x1b[2~', 'delete': '\x1b[3~', - 'end': fa('\x1bOF', '\x1b[4~'), + 'end': ca('\x1bOF', fa('\x1b[F', '\x1b[4~')), 'pageup': '\x1b[5~', 'pagedown': '\x1b[6~', 'f1': fa('\x1bOP', '\x1b[11~'), diff --git a/libesphttpd b/libesphttpd index b804b19..3237c6f 160000 --- a/libesphttpd +++ b/libesphttpd @@ -1 +1 @@ -Subproject commit b804b196fca6abf28a7e2b5bd482b76b49d518f7 +Subproject commit 3237c6f8fb9fd91b22980116b89768e1ca21cf66 diff --git a/user/apars_logging.h b/user/apars_logging.h index a4bd0f4..ce0e7ff 100644 --- a/user/apars_logging.h +++ b/user/apars_logging.h @@ -9,13 +9,21 @@ #include +#ifndef DEBUG_ANSI +#define DEBUG_ANSI 0 +#endif + +#ifndef DEBUG_ANSI_NOIMPL +#define DEBUG_ANSI_NOIMPL 0 +#endif + // defined in the makefile #if DEBUG_ANSI #define ansi_warn warn #define ansi_dbg dbg #else -#define ansi_warn(...) -#define ansi_dbg(...) +#define ansi_warn(fmt, ...) +#define ansi_dbg(fmt, ...) #endif #if DEBUG_ANSI_NOIMPL diff --git a/user/cgi_sockets.c b/user/cgi_sockets.c index e3619c5..9a49cbc 100644 --- a/user/cgi_sockets.c +++ b/user/cgi_sockets.c @@ -21,12 +21,14 @@ static ETSTimer notifyTim2; static void ICACHE_FLASH_ATTR notifyTimCb(void *arg) { void *data = NULL; + int max_bl, total_bl; + cgiWebsockMeasureBacklog(URL_WS_UPDATE, &max_bl, &total_bl); - if (!notify_available) { + if (!notify_available || (max_bl > 2048)) { // do not send if we have anything significant backlogged // postpone a little os_timer_disarm(¬ifyTim); os_timer_setfn(¬ifyTim, notifyTimCb, NULL); - os_timer_arm(¬ifyTim, 1, 0); + os_timer_arm(¬ifyTim, 5, 0); return; } notify_available = false; diff --git a/user/screen.c b/user/screen.c index 1818fb7..070d223 100644 --- a/user/screen.c +++ b/user/screen.c @@ -217,6 +217,11 @@ screen_reset(void) screen_clear_all_tabs(); + // Set initial tabstops + for (int i = 0; i < TABSTOP_WORDS; i++) { + tab_stops[i] = 0x80808080; + } + NOTIFY_DONE(); } diff --git a/user/uart_handler.c b/user/uart_handler.c index 0ee95c9..54d51b3 100755 --- a/user/uart_handler.c +++ b/user/uart_handler.c @@ -63,7 +63,7 @@ void ICACHE_FLASH_ATTR UART_SetupAsyncReceiver(void) ETS_UART_INTR_ATTACH((void *)uart0_rx_intr_handler, &(UartDev.rcv_buff)); // the buf will be used as an arg // fifo threshold config (max: UART_RXFIFO_FULL_THRHD = 127) - uint32_t conf = ((60) << UART_RXFIFO_FULL_THRHD_S); + uint32_t conf = ((90) << UART_RXFIFO_FULL_THRHD_S); conf |= ((0x10 & UART_TXFIFO_EMPTY_THRHD) << UART_TXFIFO_EMPTY_THRHD_S); // timeout config conf |= ((0x02 & UART_RX_TOUT_THRHD) << UART_RX_TOUT_THRHD_S); // timeout threshold diff --git a/user/user_main.c b/user/user_main.c index c11ec8b..49ab732 100644 --- a/user/user_main.c +++ b/user/user_main.c @@ -113,10 +113,12 @@ void ICACHE_FLASH_ATTR user_init(void) espFsInit((void *) (webpages_espfs_start)); #endif +#if DEBUG_HEAP // Heap use timer & blink os_timer_disarm(&prHeapTimer); os_timer_setfn(&prHeapTimer, prHeapTimerCb, NULL); os_timer_arm(&prHeapTimer, 1000, 1); +#endif // do later (some functions do not work if called from user_init) os_timer_disarm(&userStartTimer);