Skip to content

Conversation

@andyshinn
Copy link

Separates out the StatusLED to its own class so it can be used with repeaters for testing.

Copilot AI review requested due to automatic review settings February 11, 2026 04:16
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 logic into a reusable StatusLED helper class so it can be used across multiple example applications (including repeater testing), and updates companion radio UIs and the simple repeater example to use it.

Changes:

  • Added src/helpers/StatusLED.h encapsulating status LED timing and alert/blink behavior.
  • Updated examples/companion_radio (ui-orig and ui-new) to replace inlined LED handler code with StatusLED.
  • Updated examples/simple_repeater/main.cpp to optionally initialize and run StatusLED when PIN_STATUS_LED is defined.

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 status LED blinker/alert helper.
examples/simple_repeater/main.cpp Wires StatusLED into the repeater example’s setup/loop.
examples/companion_radio/ui-orig/UITask.h Adds StatusLED member and initializes it when enabled.
examples/companion_radio/ui-orig/UITask.cpp Removes old LED timing code and uses StatusLED in begin()/loop().
examples/companion_radio/ui-new/UITask.h Adds StatusLED member and removes old LED state fields.
examples/companion_radio/ui-new/UITask.cpp Removes old LED handler and uses StatusLED in begin()/loop().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


void loop() {
unsigned long now = millis();
if (now > _next_change) {
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

millis() rollover isn’t handled safely here: if (now > _next_change) will break after wraparound (~49 days). Use a wrap-safe comparison like (long)(now - _next_change) >= 0 (and keep _next_change as unsigned long) so the blink timing continues working across rollovers (see VolatileRTCClock::tick using unsigned subtraction in src/helpers/ArduinoHelpers.h).

Suggested change
if (now > _next_change) {
if ((long)(now - _next_change) >= 0) {

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.

1 participant