mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-06 04:36:31 +02:00
Merge pull request #102 from airgradienthq/hotfix/led-button-test-not-handle-on-power-up
fix led bar button test not work on power up
This commit is contained in:
@ -162,7 +162,7 @@ void setup() {
|
||||
bool connectToWifi = false;
|
||||
if (ag->isOne()) {
|
||||
if (ledBarButtonTest) {
|
||||
stateMachine.executeLedBarTest();
|
||||
stateMachine.executeLedBarPowerUpTest();
|
||||
} else {
|
||||
ledBarEnabledUpdate();
|
||||
connectToWifi = true;
|
||||
|
@ -319,6 +319,10 @@ void StateMachine::ledBarTest(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void StateMachine::ledBarPowerUpTest(void) {
|
||||
ledBarRunTest();
|
||||
}
|
||||
|
||||
void StateMachine::ledBarRunTest(void) {
|
||||
disp.setText("LED Test", "running", ".....");
|
||||
runLedTest('r');
|
||||
@ -699,6 +703,8 @@ void StateMachine::handleLeds(AgStateMachineState state) {
|
||||
case AgStateMachineLedBarTest:
|
||||
ledBarTest();
|
||||
break;
|
||||
case AgStateMachineLedBarPowerUpTest:
|
||||
ledBarPowerUpTest();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -752,3 +758,7 @@ void StateMachine::executeCo2Calibration(void) {
|
||||
void StateMachine::executeLedBarTest(void) {
|
||||
handleLeds(AgStateMachineLedBarTest);
|
||||
}
|
||||
|
||||
void StateMachine::executeLedBarPowerUpTest(void) {
|
||||
handleLeds(AgStateMachineLedBarPowerUpTest);
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ private:
|
||||
void pm25handleLeds(void);
|
||||
void co2Calibration(void);
|
||||
void ledBarTest(void);
|
||||
void ledBarPowerUpTest(void);
|
||||
void ledBarRunTest(void);
|
||||
void runLedTest(char color);
|
||||
|
||||
@ -49,6 +50,7 @@ public:
|
||||
AgStateMachineState getLedState(void);
|
||||
void executeCo2Calibration(void);
|
||||
void executeLedBarTest(void);
|
||||
void executeLedBarPowerUpTest(void);
|
||||
};
|
||||
|
||||
#endif /** _AG_STATE_MACHINE_H_ */
|
||||
|
@ -59,6 +59,7 @@ enum AgStateMachineState {
|
||||
|
||||
/* LED bar testing */
|
||||
AgStateMachineLedBarTest,
|
||||
AgStateMachineLedBarPowerUpTest,
|
||||
|
||||
/** LED: Show working state.
|
||||
* Display: Show dashboard */
|
||||
|
Reference in New Issue
Block a user