♻️ Consolidate PSU_CONTROL (#22304)
This commit is contained in:
committed by
GitHub
parent
37cf94b888
commit
c8ee056cc6
@@ -25,17 +25,32 @@
|
||||
* power.h - power control
|
||||
*/
|
||||
|
||||
#include "../core/millis_t.h"
|
||||
#if ENABLED(AUTO_POWER_CONTROL)
|
||||
#include "../core/millis_t.h"
|
||||
#endif
|
||||
|
||||
class Power {
|
||||
public:
|
||||
static void check(const bool pause);
|
||||
static bool psu_on;
|
||||
|
||||
static void init();
|
||||
static void power_on();
|
||||
static void power_off();
|
||||
|
||||
#if ENABLED(AUTO_POWER_CONTROL) && POWER_OFF_DELAY > 0
|
||||
static void power_off_soon();
|
||||
private:
|
||||
static millis_t lastPowerOn;
|
||||
static bool is_power_needed();
|
||||
#else
|
||||
static inline void power_off_soon() { power_off(); }
|
||||
#endif
|
||||
|
||||
#if ENABLED(AUTO_POWER_CONTROL)
|
||||
static void check(const bool pause);
|
||||
|
||||
private:
|
||||
static millis_t lastPowerOn;
|
||||
static bool is_power_needed();
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
extern Power powerManager;
|
||||
|
||||
Reference in New Issue
Block a user