Add POWER_OFF_DELAY option (#19987)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
@ -126,4 +126,12 @@ void Power::power_off() {
|
||||
}
|
||||
}
|
||||
|
||||
void Power::power_off_soon() {
|
||||
#if POWER_OFF_DELAY
|
||||
lastPowerOn = millis() - SEC_TO_MS(POWER_TIMEOUT) + SEC_TO_MS(POWER_OFF_DELAY);
|
||||
#else
|
||||
power_off();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // AUTO_POWER_CONTROL
|
||||
|
@ -32,6 +32,7 @@ class Power {
|
||||
static void check();
|
||||
static void power_on();
|
||||
static void power_off();
|
||||
static void power_off_soon();
|
||||
private:
|
||||
static millis_t lastPowerOn;
|
||||
static bool is_power_needed();
|
||||
|
Reference in New Issue
Block a user