|
@ -24,7 +24,9 @@ |
|
|
* power.cpp - power control |
|
|
* power.cpp - power control |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
#include "../inc/MarlinConfig.h" |
|
|
#include "../inc/MarlinConfigPre.h" |
|
|
|
|
|
|
|
|
|
|
|
#if EITHER(PSU_CONTROL, AUTO_POWER_CONTROL) |
|
|
|
|
|
|
|
|
#include "power.h" |
|
|
#include "power.h" |
|
|
#include "../module/planner.h" |
|
|
#include "../module/planner.h" |
|
@ -40,8 +42,6 @@ |
|
|
#include "../gcode/gcode.h" |
|
|
#include "../gcode/gcode.h" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#if EITHER(PSU_CONTROL, AUTO_POWER_CONTROL) |
|
|
|
|
|
|
|
|
|
|
|
Power powerManager; |
|
|
Power powerManager; |
|
|
bool Power::psu_on; |
|
|
bool Power::psu_on; |
|
|
|
|
|
|
|
@ -97,6 +97,10 @@ void Power::power_on() { |
|
|
* Processes any PSU_POWEROFF_GCODE and makes a PS_OFF_SOUND if enabled. |
|
|
* Processes any PSU_POWEROFF_GCODE and makes a PS_OFF_SOUND if enabled. |
|
|
*/ |
|
|
*/ |
|
|
void Power::power_off() { |
|
|
void Power::power_off() { |
|
|
|
|
|
SERIAL_ECHOLNPGM(STR_POWEROFF); |
|
|
|
|
|
|
|
|
|
|
|
TERN_(HAS_SUICIDE, suicide()); |
|
|
|
|
|
|
|
|
if (!psu_on) return; |
|
|
if (!psu_on) return; |
|
|
|
|
|
|
|
|
#ifdef PSU_POWEROFF_GCODE |
|
|
#ifdef PSU_POWEROFF_GCODE |
|
|