♻️ Consolidate PSU_CONTROL (#22304)

This commit is contained in:
Katelyn Schiesser
2021-07-11 22:13:58 -07:00
committed by GitHub
parent 37cf94b888
commit c8ee056cc6
10 changed files with 212 additions and 177 deletions

View File

@@ -236,6 +236,10 @@
#include "feature/stepper_driver_safety.h"
#endif
#if ENABLED(PSU_CONTROL)
#include "feature/power.h"
#endif
PGMSTR(M112_KILL_STR, "M112 Shutdown");
MarlinState marlin_state = MF_INITIALIZING;
@@ -883,7 +887,7 @@ void minkill(const bool steppers_off/*=false*/) {
// Power off all steppers (for M112) or just the E steppers
steppers_off ? disable_all_steppers() : disable_e_steppers();
TERN_(PSU_CONTROL, PSU_OFF());
TERN_(PSU_CONTROL, powerManager.power_off());
TERN_(HAS_SUICIDE, suicide());
@@ -1189,8 +1193,7 @@ void setup() {
#if ENABLED(PSU_CONTROL)
SETUP_LOG("PSU_CONTROL");
powersupply_on = ENABLED(PSU_DEFAULT_OFF);
if (ENABLED(PSU_DEFAULT_OFF)) PSU_OFF(); else PSU_ON();
powerManager.init();
#endif
#if ENABLED(POWER_LOSS_RECOVERY)