AUTO_POWER_SPINDLE_LASER (#25739)

This commit is contained in:
Alexey D. Filimonov
2023-08-05 03:07:56 +03:00
committed by GitHub
parent 27e68a61fa
commit 06d46a0ef9
3 changed files with 17 additions and 5 deletions

View File

@@ -412,11 +412,12 @@
//#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin
#if ENABLED(AUTO_POWER_CONTROL) #if ENABLED(AUTO_POWER_CONTROL)
#define AUTO_POWER_FANS // Turn on PSU if fans need power #define AUTO_POWER_FANS // Turn on PSU for fans
#define AUTO_POWER_E_FANS #define AUTO_POWER_E_FANS // Turn on PSU for E Fans
#define AUTO_POWER_CONTROLLERFAN #define AUTO_POWER_CONTROLLERFAN // Turn on PSU for Controller Fan
#define AUTO_POWER_CHAMBER_FAN #define AUTO_POWER_CHAMBER_FAN // Turn on PSU for Chamber Fan
#define AUTO_POWER_COOLER_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_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. //#define POWER_OFF_DELAY 60 // (s) Delay of poweroff after M81 command. Useful to let fans run for extra time.
#endif #endif

View File

@@ -53,6 +53,10 @@ bool Power::psu_on;
#include "controllerfan.h" #include "controllerfan.h"
#endif #endif
#if ANY(LASER_FEATURE, SPINDLE_FEATURE)
#include "spindle_laser.h"
#endif
millis_t Power::lastPowerOn; millis_t Power::lastPowerOn;
#endif #endif
@@ -196,6 +200,10 @@ void Power::power_off() {
if (controllerFan.state()) return true; if (controllerFan.state()) return true;
#endif #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)) if (TERN0(AUTO_POWER_CHAMBER_FAN, thermalManager.chamberfan_speed))
return true; return true;

View File

@@ -2623,6 +2623,9 @@
#if !HAS_AUTO_COOLER_FAN || AUTO_COOLER_IS_E #if !HAS_AUTO_COOLER_FAN || AUTO_COOLER_IS_E
#undef AUTO_POWER_COOLER_FAN #undef AUTO_POWER_COOLER_FAN
#endif #endif
#if !HAS_CUTTER
#undef AUTO_POWER_SPINDLE_LASER
#endif
/** /**
* Controller Fan Settings * Controller Fan Settings