[ONOFF] Set power indicator status at start (#1456)

So that it reflects the real state of the relay even if a restart of the board was done
This commit is contained in:
Florian authored and GitHub committed 2023-02-13 10:18:18 -06:00
1 parent df8943bf52
commit b7e0872f05
1 file changed
+5
+5
View File
@@ -38,6 +38,11 @@ void setupONOFF() {
xTaskCreate(overLimitTemp, "overLimitTemp", 2500, NULL, 10, NULL);
# endif
pinMode(ACTUATOR_ONOFF_GPIO, OUTPUT);
if (digitalRead(ACTUATOR_ONOFF_GPIO) == ACTUATOR_ON) {
PowerIndicatorON();
} else {
PowerIndicatorOFF();
}
# ifdef ACTUATOR_ONOFF_DEFAULT
digitalWrite(ACTUATOR_ONOFF_GPIO, ACTUATOR_ONOFF_DEFAULT);
# endif