Browse Source

🎨 Small tweak, ms => now

vanilla_fb_2.0.x
Scott Lahteine 4 years ago
parent
commit
ec518e6e7b
  1. 8
      Marlin/src/feature/power.cpp

8
Marlin/src/feature/power.cpp

@ -105,12 +105,12 @@ bool Power::is_power_needed() {
void Power::check() { void Power::check() {
static millis_t nextPowerCheck = 0; static millis_t nextPowerCheck = 0;
millis_t ms = millis(); millis_t now = millis();
if (ELAPSED(ms, nextPowerCheck)) { if (ELAPSED(now, nextPowerCheck)) {
nextPowerCheck = ms + 2500UL; nextPowerCheck = now + 2500UL;
if (is_power_needed()) if (is_power_needed())
power_on(); power_on();
else if (!lastPowerOn || (POWER_TIMEOUT > 0 && ELAPSED(ms, lastPowerOn + SEC_TO_MS(POWER_TIMEOUT)))) else if (!lastPowerOn || (POWER_TIMEOUT > 0 && ELAPSED(now, lastPowerOn + SEC_TO_MS(POWER_TIMEOUT))))
power_off(); power_off();
} }
} }

Loading…
Cancel
Save