From dd9f70bc99894ac048d55a5ff87e9596a2ded228 Mon Sep 17 00:00:00 2001 From: Jody Bentley Date: Wed, 24 Jun 2026 19:15:21 -0400 Subject: [PATCH] ThinkNode M6: run UITask headless to enable status LED, button and low-battery shutdown The M6's two LEDs work in the bootloader and on other firmware, but the MeshCore companion builds gave no status indication: the red LED (P0.12) was initialised off and never used, and the blue LED only blinked on LoRa TX. The companion status LED, user-button handling and low-battery auto-shutdown all live in UITask, which is only instantiated when DISPLAY_CLASS is defined. The M6 is screenless, so UITask never ran and none of those worked - including AUTO_SHUTDOWN_MILLIVOLTS, which was set in the env but had no effect. Run UITask headless via NullDisplayDriver, the same way the other screenless boards (t1000-e, RAK WisMesh Tag) do, and define PIN_STATUS_LED. This enables: - status LED on the previously-unused red LED (heartbeat, longer blink on unread messages); blue keeps its LoRa-TX function - the user button (navigation + long-press), groundwork for the shutdown request in #2313 - the already-configured low-battery auto-shutdown (3.3V) Applied to both companion_radio_ble and companion_radio_usb. The LED pins/polarity were already correct (RED=12, BLUE=7, active-high), so no hardware-config change is needed. Relates to #2313. --- variants/thinknode_m6/platformio.ini | 6 ++++++ variants/thinknode_m6/target.h | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/variants/thinknode_m6/platformio.ini b/variants/thinknode_m6/platformio.ini index 6fe9043668..72f4167253 100644 --- a/variants/thinknode_m6/platformio.ini +++ b/variants/thinknode_m6/platformio.ini @@ -85,12 +85,15 @@ build_flags = -D OFFLINE_QUEUE_SIZE=256 -D AUTO_SHUTDOWN_MILLIVOLTS=3300 -D QSPIFLASH=1 + -D DISPLAY_CLASS=NullDisplayDriver + -D PIN_STATUS_LED=PIN_LED_RED ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 build_src_filter = ${ThinkNode_M6.build_src_filter} + + +<../examples/companion_radio/*.cpp> + +<../examples/companion_radio/ui-new/*.cpp> lib_deps = ${ThinkNode_M6.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -109,10 +112,13 @@ build_flags = -D QSPIFLASH=1 -D OFFLINE_QUEUE_SIZE=256 -D AUTO_SHUTDOWN_MILLIVOLTS=3300 + -D DISPLAY_CLASS=NullDisplayDriver + -D PIN_STATUS_LED=PIN_LED_RED build_src_filter = ${ThinkNode_M6.build_src_filter} + + +<../examples/companion_radio/*.cpp> + +<../examples/companion_radio/ui-new/*.cpp> lib_deps = ${ThinkNode_M6.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/thinknode_m6/target.h b/variants/thinknode_m6/target.h index 76188e584e..07ff322947 100644 --- a/variants/thinknode_m6/target.h +++ b/variants/thinknode_m6/target.h @@ -10,7 +10,9 @@ #include #include #ifdef DISPLAY_CLASS - #include + // The M6 is screenless; DISPLAY_CLASS=NullDisplayDriver is used only to run + // UITask headless so the status LED (PIN_STATUS_LED) and button work. + #include #include #endif