Explicitly set power output

This commit is contained in:
C0d3v 2026-01-15 20:35:52 +01:00
parent 0f867c2248
commit 120c89e3a4

View File

@ -111,19 +111,20 @@ bool checkPowerState()
rawState != powerStableState) rawState != powerStableState)
{ {
powerStableState = rawState; powerStableState = rawState;
digitalWrite(PIN_POWER_SWITCH_OUTPUT, powerStableState == HIGH); if (powerStableState)
if (powerStableState == HIGH)
{ {
setDrawerLight(selectedIndex); setDrawerLight(selectedIndex);
digitalWrite(PIN_POWER_SWITCH_OUTPUT, HIGH);
enableEncoder(); enableEncoder();
} }
else else
{ {
turnLightsOff(); turnLightsOff();
digitalWrite(PIN_POWER_SWITCH_OUTPUT, LOW);
disableEncoder(); disableEncoder();
} }
} }
return (powerStableState == HIGH); return powerStableState;
} }
/* ========================================================= */ /* ========================================================= */