ThinkNode M6: enable status LED, button and low-battery shutdown (run UITask)#2837
Open
benskigomez wants to merge 1 commit into
Open
ThinkNode M6: enable status LED, button and low-battery shutdown (run UITask)#2837benskigomez wants to merge 1 commit into
benskigomez wants to merge 1 commit into
Conversation
…w-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 meshcore-dev#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 meshcore-dev#2313.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Elecrow ThinkNode M6's two LEDs work in the bootloader and on other firmware, but the MeshCore companion builds give no status indication. The red LED (P0.12) is initialised off and never used again; the blue LED only blinks on LoRa TX.
Cause
The companion status LED, user-button handling, and low-battery auto-shutdown all live in
UITask, which is only instantiated whenDISPLAY_CLASSis defined. The M6 is screenless, soUITasknever ran — meaningPIN_STATUS_LEDwas never set, the button was inert, and even theAUTO_SHUTDOWN_MILLIVOLTS=3300flag already in the env had no effect.Fix
Run
UITaskheadless withNullDisplayDriver, exactly as the other screenless boards (t1000-e, RAK WisMesh Tag) do, and definePIN_STATUS_LED. This enables, on bothcompanion_radio_bleandcompanion_radio_usb:The LED pins/polarity were already correct (RED=12, BLUE=7, active-high), so no hardware-config change is needed — only
target.h(useNullDisplayDriverinstead of the leftover e-paper include) and the two env definitions.Testing
Built and flashed on a ThinkNode M6: the red LED now shows the heartbeat and blinks longer with unread messages; the blue TX blink is unchanged. Both companion BLE and USB build and run.
Notes
Relates to #2313 (Shutdown for ThinkNode M6) — this makes the user button active, which is a prerequisite for button-driven shutdown, though this PR doesn't add a dedicated long-press-shutdown/wakeup mapping itself.