Added power off timeout
This commit is contained in:
parent
12e8861a1c
commit
c9891be599
3 changed files with 7 additions and 0 deletions
|
|
@ -338,6 +338,8 @@
|
|||
//#define PSU_POWERUP_GCODE "M355 S1" // G-code to run after power-on (e.g., case light on)
|
||||
//#define PSU_POWEROFF_GCODE "M355 S0" // G-code to run before power-off (e.g., case light off)
|
||||
|
||||
//#define POWER_OFF_TIMEOUT 30 // (s) Delay for the shutoff of the PSU; for example used to let a cooling-fan run after print is finished
|
||||
|
||||
//#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
|
||||
|
|
|
|||
|
|
@ -122,6 +122,7 @@ void Power::power_off() {
|
|||
#ifdef PSU_POWEROFF_GCODE
|
||||
GcodeSuite::process_subcommands_now_P(PSTR(PSU_POWEROFF_GCODE));
|
||||
#endif
|
||||
safe_delay(SEC_TO_MS(POWER_OFF_TIMEOUT));
|
||||
PSU_PIN_OFF();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -420,6 +420,10 @@
|
|||
#define PSU_POWERUP_DELAY 250
|
||||
#endif
|
||||
|
||||
#if !defined(POWER_OFF_TIMEOUT) && ENABLED(PSU_CONTROL)
|
||||
#define POWER_OFF_TIMEOUT 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Temp Sensor defines
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue