M81 D / S - Power-off Delay (#23396)

This commit is contained in:
John Lagonikas
2022-01-03 18:11:39 +02:00
committed by GitHub
parent b8a376a28a
commit 9a194826e3
9 changed files with 130 additions and 42 deletions

View File

@@ -36,21 +36,37 @@ class Power {
static void init();
static void power_on();
static void power_off();
#if EITHER(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN)
#if ENABLED(POWER_OFF_TIMER)
static millis_t power_off_time;
static void setPowerOffTimer(const millis_t delay_ms);
#endif
#if ENABLED(POWER_OFF_WAIT_FOR_COOLDOWN)
static bool power_off_on_cooldown;
static void setPowerOffOnCooldown(const bool ena);
#endif
static void cancelAutoPowerOff();
static void checkAutoPowerOff();
#endif
#if ENABLED(AUTO_POWER_CONTROL) && POWER_OFF_DELAY > 0
static void power_off_soon();
#else
static void power_off_soon() { power_off(); }
#endif
#if ENABLED(AUTO_POWER_CONTROL) && POWER_OFF_DELAY > 0
static void power_off_soon();
#else
static void power_off_soon() { power_off(); }
#endif
#if ENABLED(AUTO_POWER_CONTROL)
static void check(const bool pause);
#if ENABLED(AUTO_POWER_CONTROL)
static void check(const bool pause);
private:
static millis_t lastPowerOn;
static bool is_power_needed();
#endif
private:
static millis_t lastPowerOn;
static bool is_power_needed();
static bool is_cooling_needed();
#elif ENABLED(POWER_OFF_WAIT_FOR_COOLDOWN)
private:
static bool is_cooling_needed();
#endif
};
extern Power powerManager;