From f8eb8b33e0a827267de781f9fbf380c299cfebeb Mon Sep 17 00:00:00 2001 From: Benjamin Runnels Date: Thu, 10 Dec 2015 06:44:52 -0600 Subject: [PATCH] Fix for services page syslog filter select list Fix for a couple compiler errors when cycling the different undef and define options in user_config.h --- esp-link/cgiservices.c | 2 +- esp-link/cgiwifi.c | 1 + html/services.js | 6 +++++- mqtt/pktbuf.c | 24 ++++++++++++------------ 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/esp-link/cgiservices.c b/esp-link/cgiservices.c index 447c6e2..81f7200 100644 --- a/esp-link/cgiservices.c +++ b/esp-link/cgiservices.c @@ -98,7 +98,7 @@ void ICACHE_FLASH_ATTR cgiServicesSNTPInit() { sntp_setservername(0, flashConfig.sntp_server); sntp_init(); } - DBG("SNTP timesource set to %s with offset %d", flashConfig.sntp_server, flashConfig.timezone_offset); + DBG("SNTP timesource set to %s with offset %d\n", flashConfig.sntp_server, flashConfig.timezone_offset); } } diff --git a/esp-link/cgiwifi.c b/esp-link/cgiwifi.c index de49938..b83a330 100644 --- a/esp-link/cgiwifi.c +++ b/esp-link/cgiwifi.c @@ -619,6 +619,7 @@ int ICACHE_FLASH_ATTR cgiWifiInfo(HttpdConnData *connData) { void ICACHE_FLASH_ATTR wifiInit() { // wifi_set_phy_mode(2); // limit to 802.11b/g 'cause n is flaky int x = wifi_get_opmode() & 0x3; + x = x; DBG("Wifi init, mode=%s\n", wifiMode[x]); configWifiIP(); diff --git a/html/services.js b/html/services.js index 50d0138..0880f85 100644 --- a/html/services.js +++ b/html/services.js @@ -1,7 +1,7 @@ function changeServices(e) { e.preventDefault(); var url = "services/update?1=1"; - var i, inputs = document.querySelectorAll("#" + e.srcElement.id + " input"); + var i, inputs = document.querySelectorAll("#" + e.srcElement.id + " input,select"); for (i = 0; i < inputs.length; i++) { if (inputs[i].type == "checkbox") { if (inputs[i].name.slice(-6) == "enable") @@ -35,7 +35,11 @@ function displayServices(data) { else el.innerHTML = data[v]; return; } + el = document.querySelector('input[name="' + v + '"]'); + if (el == null) + el = document.querySelector('select[name="' + v + '"]'); + if (el != null) { if (el.type == "checkbox") { el.checked = data[v] == "enabled"; diff --git a/mqtt/pktbuf.c b/mqtt/pktbuf.c index a3ac7af..76a6bb9 100644 --- a/mqtt/pktbuf.c +++ b/mqtt/pktbuf.c @@ -4,18 +4,18 @@ #include "pktbuf.h" #ifdef PKTBUF_DBG -static void ICACHE_FLASH_ATTR -PktBuf_Print(PktBuf *buf) { - os_printf("PktBuf:"); - for (int i=-16; i<0; i++) - os_printf(" %02X", ((uint8_t*)buf)[i]); - os_printf(" %p", buf); - for (int i=0; i<16; i++) - os_printf(" %02X", ((uint8_t*)buf)[i]); - os_printf("\n"); - os_printf("PktBuf: next=%p len=0x%04x\n", - ((void**)buf)[-4], ((uint16_t*)buf)[-6]); -} +//static void ICACHE_FLASH_ATTR +//PktBuf_Print(PktBuf *buf) { +// os_printf("PktBuf:"); +// for (int i=-16; i<0; i++) +// os_printf(" %02X", ((uint8_t*)buf)[i]); +// os_printf(" %p", buf); +// for (int i=0; i<16; i++) +// os_printf(" %02X", ((uint8_t*)buf)[i]); +// os_printf("\n"); +// os_printf("PktBuf: next=%p len=0x%04x\n", +// ((void**)buf)[-4], ((uint16_t*)buf)[-6]); +//} #endif