move statusLED to its own class and allow using for repeater#36
move statusLED to its own class and allow using for repeater#36andyshinn wants to merge 1 commit intoweebl2000:dev_plusfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extracts the status LED blink/alert behavior into a reusable StatusLED helper so it can be used outside the companion UI (notably on repeaters) to aid debugging by showing that the main loop is still running.
Changes:
- Added
StatusLEDhelper class undersrc/helpers/. - Wired the new
StatusLEDintoexamples/simple_repeatermain loop. - Replaced the companion UI’s ad-hoc LED handler (both
ui-origandui-new) with the sharedStatusLEDclass.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/helpers/StatusLED.h |
Introduces a reusable LED blink/alert helper. |
examples/simple_repeater/main.cpp |
Instantiates and runs StatusLED when PIN_STATUS_LED is available. |
examples/companion_radio/ui-orig/UITask.h |
Adds a StatusLED member and constructor initialization. |
examples/companion_radio/ui-orig/UITask.cpp |
Removes legacy LED handler and drives the new StatusLED with _msgcount as alert signal. |
examples/companion_radio/ui-new/UITask.h |
Replaces legacy LED state variables with a StatusLED member. |
examples/companion_radio/ui-new/UITask.cpp |
Removes legacy LED handler and drives the new StatusLED with _msgcount as alert signal. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #ifdef PIN_STATUS_LED | ||
| #include <helpers/StatusLED.h> | ||
| #endif |
There was a problem hiding this comment.
#include <helpers/StatusLED.h> is wrapped in #ifdef PIN_STATUS_LED but it appears before any header that guarantees PIN_STATUS_LED is defined (e.g., ../AbstractUITask.h includes <Arduino.h> later). If PIN_STATUS_LED becomes defined only after those later includes, the #include is skipped while the later StatusLED status_led; member is still compiled, which will break the build due to an unknown type. Move the StatusLED.h include to a point after PIN_STATUS_LED is known (or include StatusLED.h unconditionally and keep only the member/usage under #ifdef).
| #ifdef PIN_STATUS_LED | |
| #include <helpers/StatusLED.h> | |
| #endif | |
| #include <helpers/StatusLED.h> |
This moves the StatusLED class outside of companion so that it can also be used on repeaters. Good for debugging a repeater that may have failed to see if the loop is still running.