diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 27d4205e71b9..d381145ad7dd 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -423,11 +423,12 @@ //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define AUTO_POWER_CHAMBER_FAN - #define AUTO_POWER_COOLER_FAN + #define AUTO_POWER_FANS // Turn on PSU for fans + #define AUTO_POWER_E_FANS // Turn on PSU for E Fans + #define AUTO_POWER_CONTROLLERFAN // Turn on PSU for Controller Fan + #define AUTO_POWER_CHAMBER_FAN // Turn on PSU for Chamber Fan + #define AUTO_POWER_COOLER_FAN // Turn on PSU for Cooler Fan + #define AUTO_POWER_SPINDLE_LASER // Turn on PSU for Spindle/Laser #define POWER_TIMEOUT 30 // (s) Turn off power if the machine is idle for this duration //#define POWER_OFF_DELAY 60 // (s) Delay of poweroff after M81 command. Useful to let fans run for extra time. #endif diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index d0f8a66fec36..e908c8292fd6 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/power.cpp @@ -53,6 +53,10 @@ bool Power::psu_on; #include "controllerfan.h" #endif + #if ANY(LASER_FEATURE, SPINDLE_FEATURE) + #include "spindle_laser.h" + #endif + millis_t Power::lastPowerOn; #endif @@ -196,6 +200,10 @@ void Power::power_off() { if (controllerFan.state()) return true; #endif + #if ANY(LASER_FEATURE, SPINDLE_FEATURE) + if (TERN0(AUTO_POWER_SPINDLE_LASER, cutter.enabled())) return true; + #endif + if (TERN0(AUTO_POWER_CHAMBER_FAN, thermalManager.chamberfan_speed)) return true; diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 13f20114e509..8f3a2eee27b9 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2623,6 +2623,9 @@ #if !HAS_AUTO_COOLER_FAN || AUTO_COOLER_IS_E #undef AUTO_POWER_COOLER_FAN #endif +#if !HAS_CUTTER + #undef AUTO_POWER_SPINDLE_LASER +#endif /** * Controller Fan Settings