Update OpenAir provision ready led pattern

This commit is contained in:
samuelbles07
2025-12-05 23:45:14 +07:00
parent b5d89cf118
commit 0f1846f040
3 changed files with 32 additions and 1 deletions

View File

@@ -645,7 +645,7 @@ void StateMachine::handleLeds(AgStateMachineState state) {
ag->ledBar.clear();
ag->ledBar.setColor(0, 0, 255, ag->ledBar.getNumberOfLeds() / 2);
} else {
ag->statusLed.setToggle();
ag->statusLed.setStep();
}
break;
}

View File

@@ -72,6 +72,36 @@ void StatusLed::setToggle(void) {
}
}
void StatusLed::setStep(void) {
static uint8_t step = 0;
// Pattern definition
const bool pattern[] = {
true, // 0: ON
false, // 1: OFF
true, // 2: ON
false, // 3: OFF
false, // 4: OFF
false, // 5: OFF
false, // 6: OFF
false, // 7: OFF
false, // 8: OFF
false // 9: OFF
};
if (pattern[step]) {
this->setOn();
} else {
this->setOff();
}
step++;
if (step >= sizeof(pattern)) {
step = 0; // restart pattern
}
}
/**
* @brief Get current LED state
*

View File

@@ -25,6 +25,7 @@ public:
void setOn(void);
void setOff(void);
void setToggle(void);
void setStep(void);
State getState(void);
String toString(StatusLed::State state);