From efc476e50b336a028e25ab7b8a3f3520dca7380f Mon Sep 17 00:00:00 2001 From: cschwinne Date: Sat, 3 Dec 2022 20:55:17 +0100 Subject: [PATCH] Disable register keyword to reduce compiler warnings Minor formatting improvements "ps" string optimization Removed travis envs --- platformio.ini | 32 +++---------------- usermods/TTGO-T-Display/README.md | 4 +-- .../usermod_v2_rotary_encoder_ui_ALT.h | 2 +- wled00/cfg.cpp | 4 +-- wled00/json.cpp | 2 +- wled00/led.cpp | 8 ++--- wled00/wled.h | 2 +- wled00/ws.cpp | 10 +++--- 8 files changed, 20 insertions(+), 44 deletions(-) diff --git a/platformio.ini b/platformio.ini index 931dc38f..64427bf1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -6,16 +6,14 @@ # ENVIRONMENTS # # Please uncomment one of the lines below to select your board(s) +# (use `platformio_override.ini` when building for your own board; see `platformio_override.ini.sample` for an example) # ------------------------------------------------------------------------------ -# Travis CI binaries (use `platformio_override.ini` when building for your own board; see `platformio_override.ini.sample` for an example) -; default_envs = travis_esp8266, travis_esp32 - -# Release binaries +# Release / CI binaries default_envs = nodemcuv2, esp8266_2m, esp01_1m_full, esp32dev, esp32_eth, esp32s2_saola, esp32c3 # Build everything -; default_envs = esp32dev, esp8285_4CH_MagicHome, codm-controller-0.6-rev2, codm-controller-0.6, esp32s2_saola, d1_mini_5CH_Shojo_PCB, d1_mini, sp501e, travis_esp8266, travis_esp32, nodemcuv2, esp32_eth, anavi_miracle_controller, esp07, esp01_1m_full, m5atom, h803wf, d1_mini_ota, heltec_wifi_kit_8, esp8285_H801, d1_mini_debug, wemos_shield_esp32, elekstube_ips +; default_envs = esp32dev, esp8285_4CH_MagicHome, codm-controller-0.6-rev2, codm-controller-0.6, esp32s2_saola, d1_mini_5CH_Shojo_PCB, d1_mini, sp501e, nodemcuv2, esp32_eth, anavi_miracle_controller, esp07, esp01_1m_full, m5atom, h803wf, d1_mini_ota, heltec_wifi_kit_8, esp8285_H801, d1_mini_debug, wemos_shield_esp32, elekstube_ips # Single binaries (uncomment your board) ; default_envs = elekstube_ips @@ -113,6 +111,7 @@ build_flags = -D DECODE_SONY=true -D DECODE_SAMSUNG=true -D DECODE_LG=true + -Dregister= # remove warnings in C++17 due to use of deprecated register keyword by the FastLED library -DWLED_USE_MY_CONFIG ; -D USERMOD_SENSORSTOMQTT #For ADS1115 sensor uncomment following @@ -120,13 +119,6 @@ build_flags = build_unflags = -# enables all features for travis CI -build_flags_all_features = - -D WLED_ENABLE_ADALIGHT - -D WLED_ENABLE_DMX - -D WLED_ENABLE_MQTT - -D WLED_ENABLE_WEBSOCKETS - build_flags_esp8266 = ${common.build_flags} ${esp8266.build_flags} build_flags_esp32 = ${common.build_flags} ${esp32.build_flags} @@ -588,22 +580,6 @@ build_unflags = ${common.build_unflags} build_flags = ${common.build_flags_esp8266} -D WLED_RELEASE_NAME=ESP01 -D WLED_DISABLE_OTA -D USERMOD_MY9291 lib_deps = ${esp8266.lib_deps} -# ------------------------------------------------------------------------------ -# travis test board configurations -# ------------------------------------------------------------------------------ - -[env:travis_esp8266] -extends = env:d1_mini -build_type = debug -build_unflags = ${common.build_unflags} -build_flags = ${common.build_flags_esp8266} ${common.debug_flags} ${common.build_flags_all_features} - -[env:travis_esp32] -extends = env:esp32dev -; build_type = debug -build_unflags = ${common.build_unflags} -build_flags = ${common.build_flags_esp32} ${common.debug_flags} ${common.build_flags_all_features} - # ------------------------------------------------------------------------------ # codm pixel controller board configurations # codm-controller-0.6 can also be used for the TYWE3S controller diff --git a/usermods/TTGO-T-Display/README.md b/usermods/TTGO-T-Display/README.md index 872beeb8..9f12f754 100644 --- a/usermods/TTGO-T-Display/README.md +++ b/usermods/TTGO-T-Display/README.md @@ -55,8 +55,8 @@ Also, while in the `platformio.ini` file, you must change the environment setup Comment out the line described below: ```ini -# Travis CI binaries (comment this out when building for single board) -; default_envs = travis_esp8266, esp01, esp01_1m_ota, travis_esp32 +# Release binaries +; default_envs = nodemcuv2, esp8266_2m, esp01_1m_full, esp32dev, esp32_eth, esp32s2_saola, esp32c3 ``` and UNCOMMENT the following line in the 'Single binaries' section: ```ini diff --git a/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h b/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h index b5aed94d..35d3e6f3 100644 --- a/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h +++ b/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h @@ -750,7 +750,7 @@ public: StaticJsonDocument<64> root; char str[64]; sprintf_P(str, PSTR("%d~%d~%s"), presetLow, presetHigh, increase?"":"-"); - root[F("ps")] = str; + root["ps"] = str; deserializeState(root.as(), CALL_MODE_BUTTON_PRESET); /* String apireq = F("win&PL=~"); diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index 32c2a0d5..51d0a1eb 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -104,7 +104,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) { CJSON(strip.matrix.bottomStart, matrix[F("pb")]); CJSON(strip.matrix.rightStart, matrix[F("pr")]); CJSON(strip.matrix.vertical, matrix[F("pv")]); - CJSON(strip.matrix.serpentine, matrix[F("ps")]); + CJSON(strip.matrix.serpentine, matrix["ps"]); JsonArray panels = matrix[F("panels")]; uint8_t s = 0; @@ -694,7 +694,7 @@ void serializeConfig() { matrix[F("pb")] = strip.matrix.bottomStart; matrix[F("pr")] = strip.matrix.rightStart; matrix[F("pv")] = strip.matrix.vertical; - matrix[F("ps")] = strip.matrix.serpentine; + matrix["ps"] = strip.matrix.serpentine; JsonArray panels = matrix.createNestedArray(F("panels")); for (uint8_t i=0; i 0) lastNlUpdate = 0; //take care of millis() rollover - if (now - lastNlUpdate < 100) return; //allow only 10 NL updates per second + if (now < 100 && lastNlUpdate > 0) lastNlUpdate = 0; // take care of millis() rollover + if (now - lastNlUpdate < 100) return; // allow only 10 NL updates per second lastNlUpdate = now; if (nightlightActive) diff --git a/wled00/wled.h b/wled00/wled.h index 373e5d62..13fd7139 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2211300 +#define VERSION 2212030 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG diff --git a/wled00/ws.cpp b/wled00/ws.cpp index 8c1a9d3d..4e12319f 100644 --- a/wled00/ws.cpp +++ b/wled00/ws.cpp @@ -22,15 +22,15 @@ void wsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventTyp if (client->id() == wsLiveClientId) wsLiveClientId = 0; DEBUG_PRINTLN(F("WS client disconnected.")); } else if(type == WS_EVT_DATA){ - //data packet + // data packet AwsFrameInfo * info = (AwsFrameInfo*)arg; if(info->final && info->index == 0 && info->len == len){ - //the whole message is in a single frame and we got all of its data (max. 1450byte) + // the whole message is in a single frame and we got all of its data (max. 1450 bytes) if(info->opcode == WS_TEXT) { if (len > 0 && len < 10 && data[0] == 'p') { - //application layer ping/pong heartbeat. - //client-side socket layer ping packets are unresponded (investigate) + // application layer ping/pong heartbeat. + // client-side socket layer ping packets are unresponded (investigate) client->text(F("pong")); return; } @@ -54,7 +54,7 @@ void wsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventTyp } releaseJSONBufferLock(); // will clean fileDoc - // force broadcast in 500ms after upadting client + // force broadcast in 500ms after updating client if (verboseResponse) { sendDataWs(client); lastInterfaceUpdate = millis() - (INTERFACE_UPDATE_COOLDOWN -500);