From b34a1b57d64baf54f6ad0d23677e3ab6e2a0f413 Mon Sep 17 00:00:00 2001 From: proddy Date: Mon, 4 May 2026 08:38:41 +0200 Subject: [PATCH 1/3] fix warning "esp32-hal-gpio.c:181] __digitalWrite(): IO 2 is not set as GPIO. Execute digitalMode(2, OUTPUT) first" --- src/core/system.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/core/system.cpp b/src/core/system.cpp index 350a304bf..3e01a6e93 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -840,19 +840,21 @@ void System::button_init() { // set the LED to on or off when in normal operating mode void System::led_init() { - // disabled old led port before setting new one - led_type_ ? EMSESP_RGB_WRITE(led_gpio_, 0, 0, 0) : digitalWrite(led_gpio_, !LED_ON); + // RGB: drive strip low before init. Standard GPIO LED: pinMode must precede digitalWrite (ESP32 Arduino hal). + if (led_type_) { + EMSESP_RGB_WRITE(led_gpio_, 0, 0, 0); + } - if ((led_gpio_)) { // 0 means disabled - if (led_type_) { - // rgb LED WS2812B, use Neopixel - EMSESP_RGB_WRITE(led_gpio_, 0, 0, 0); - } else { - pinMode(led_gpio_, OUTPUT); - digitalWrite(led_gpio_, !LED_ON); // start with LED off - } - } else { + if (!led_gpio_) { // 0 means disabled LOG_INFO("LED disabled"); + return; + } + + if (led_type_) { + EMSESP_RGB_WRITE(led_gpio_, 0, 0, 0); + } else { + pinMode(led_gpio_, OUTPUT); + digitalWrite(led_gpio_, !LED_ON); // start with LED off } } From cc631ff07f0cbacfecb70d0b3e76dd260867d0ae Mon Sep 17 00:00:00 2001 From: proddy Date: Mon, 4 May 2026 20:48:12 +0200 Subject: [PATCH 2/3] remove digitalWrite at init --- src/core/system.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/core/system.cpp b/src/core/system.cpp index 3e01a6e93..8499b1c37 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -840,11 +840,6 @@ void System::button_init() { // set the LED to on or off when in normal operating mode void System::led_init() { - // RGB: drive strip low before init. Standard GPIO LED: pinMode must precede digitalWrite (ESP32 Arduino hal). - if (led_type_) { - EMSESP_RGB_WRITE(led_gpio_, 0, 0, 0); - } - if (!led_gpio_) { // 0 means disabled LOG_INFO("LED disabled"); return; From c55df4eb6e2ccc53875b056bdd628fa628921b42 Mon Sep 17 00:00:00 2001 From: proddy Date: Mon, 4 May 2026 20:57:20 +0200 Subject: [PATCH 3/3] fix standalone build lint warning --- src/web/WebStatusService.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/web/WebStatusService.cpp b/src/web/WebStatusService.cpp index ae1d21eb8..69dc2ca25 100644 --- a/src/web/WebStatusService.cpp +++ b/src/web/WebStatusService.cpp @@ -372,13 +372,11 @@ void WebStatusService::getVersions(JsonObject root) { // schedule the next versions.json fetch a few seconds out so the network stack has time to settle // (DHCP completion, default-netif assignment and DNS server propagation through lwip) void WebStatusService::schedule_versions_refresh() { -#ifndef EMSESP_STANDALONE uint32_t next = uuid::get_uptime() + VERSIONS_INITIAL_FETCH_DELAY_MS; if (next == 0) { next = 1; // 0 is the "idle" sentinel — never let the wrap land there } versions_next_fetch_ms_ = next; -#endif } // periodic refresh (1 hour) of the cached versions.json