Skip to content

Commit 955f8b6

Browse files
committed
turn on red led at the test end
1 parent 7faf9cc commit 955f8b6

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

examples/utility/Provisioning_2.0/Provisioning_2.0.ino

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,18 @@ void sendStatus(StatusMessage msg) {
9797
uint32_t lastLedStatusChanged = 0;
9898
bool ledactive = false;
9999
DeviceState handleOptaTest() {
100-
101-
if(millis() - lastLedStatusChanged > 250){
102-
lastLedStatusChanged = millis();
103-
ledactive = !ledactive;
104-
digitalWrite(LEDG, ledactive);
100+
bool running = OptaFactoryTest.poll();
101+
if(!running){
102+
digitalWrite(LEDG, LOW);
103+
digitalWrite(LEDR, HIGH);
104+
} else {
105+
if(millis() - lastLedStatusChanged > 250){
106+
lastLedStatusChanged = millis();
107+
ledactive = !ledactive;
108+
digitalWrite(LEDG, ledactive);
109+
}
105110
}
106111

107-
OptaFactoryTest.poll();
108112
return DeviceState::OPTA_TEST;
109113
}
110114
#endif

0 commit comments

Comments
 (0)