Skip to content

move statusLED to its own class and allow using for repeater#36

Open
andyshinn wants to merge 1 commit intoweebl2000:dev_plusfrom
andyshinn:ashinn/status-led-repeater-weebl
Open

move statusLED to its own class and allow using for repeater#36
andyshinn wants to merge 1 commit intoweebl2000:dev_plusfrom
andyshinn:ashinn/status-led-repeater-weebl

Conversation

@andyshinn
Copy link

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.

Copilot AI review requested due to automatic review settings March 2, 2026 21:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 StatusLED helper class under src/helpers/.
  • Wired the new StatusLED into examples/simple_repeater main loop.
  • Replaced the companion UI’s ad-hoc LED handler (both ui-orig and ui-new) with the shared StatusLED class.

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.

Comment on lines +11 to +13
#ifdef PIN_STATUS_LED
#include <helpers/StatusLED.h>
#endif
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#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).

Suggested change
#ifdef PIN_STATUS_LED
#include <helpers/StatusLED.h>
#endif
#include <helpers/StatusLED.h>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants