File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -240,12 +240,14 @@ static void powerKeepAliveTimerISR()
240240 if (shutdownState == 0 )
241241 {
242242 unsigned long timeSinceLastPowerKeepAlive = millis () - timeOfLastPowerKeepAlive;
243- if (!digitalRead (IP5306_BUTTON) && timeSinceLastPowerKeepAlive > POWER_KEEP_ALIVE_INTERVAL_MS)
243+ bool ip5306ButtonState = digitalRead (IP5306_BUTTON);
244+
245+ if (!ip5306ButtonState && timeSinceLastPowerKeepAlive > POWER_KEEP_ALIVE_INTERVAL_MS)
244246 {
245247 timeOfLastPowerKeepAlive = millis ();
246248 digitalWrite (IP5306_BUTTON, HIGH);
247249 }
248- else if (digitalRead (IP5306_BUTTON) && timeSinceLastPowerKeepAlive > 300 )
250+ else if (ip5306ButtonState && timeSinceLastPowerKeepAlive > 300 )
249251 {
250252 timeOfLastPowerKeepAlive = millis ();
251253 digitalWrite (IP5306_BUTTON, LOW);
You can’t perform that action at this time.
0 commit comments