Skip to content

Commit

Permalink
single instance, not required
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jan 3, 2022
1 parent 1927f77 commit 20eb3e9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
16 changes: 7 additions & 9 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@
//#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80
//#define PSU_POWERUP_DELAY 250 // (ms) Delay for the PSU to warm up to full power

//#define POWER_OFF_TIMER // Enable M81 Dnnn switch (delay power off for nnn seconds)
//#define POWER_OFF_WAIT_FOR_COOLDOWN // Enable M81 S1 switch (delay power off until cooldown)
//#define POWER_OFF_TIMER // Enable M81 D<seconds> to power off after a delay
//#define POWER_OFF_WAIT_FOR_COOLDOWN // Enable M81 S to power off only after cooldown

//#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)
Expand All @@ -387,15 +387,13 @@
#define AUTO_POWER_CONTROLLERFAN
#define AUTO_POWER_CHAMBER_FAN
#define AUTO_POWER_COOLER_FAN
//#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU if any extruder is over this temperature
//#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU if the chamber is over this temperature
//#define AUTO_POWER_COOLER_TEMP 26 // (°C) Turn on PSU if the cooler is over this temperature
#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.
#elif ENABLED(POWER_OFF_WAIT_FOR_COOLDOWN)
#define AUTO_POWER_E_TEMP 50 // (°C) Don't turn off PSU until all extruders are under this temperature
#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Don't turn off PSU until the chamber is under this temperature
#define AUTO_POWER_COOLER_TEMP 26 // (°C) Don't turn off PSU until the cooler is under this temperature
#endif
#if EITHER(AUTO_POWER_CONTROL, POWER_OFF_WAIT_FOR_COOLDOWN)
//#define AUTO_POWER_E_TEMP 50 // (°C) PSU on if any extruder is over this temperature
//#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) PSU on if the chamber is over this temperature
//#define AUTO_POWER_COOLER_TEMP 26 // (°C) PSU on if the cooler is over this temperature
#endif
#endif

Expand Down
12 changes: 0 additions & 12 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,18 +489,6 @@
#ifndef POWER_OFF_DELAY
#define POWER_OFF_DELAY 0
#endif
#ifdef POWER_OFF_WAIT_FOR_COOLDOWN // temp thresholds are mandatory; an extreme room temperature (50°C) is safe and sufficiently high
#ifndef AUTO_POWER_E_TEMP
#define AUTO_POWER_E_TEMP 50
#endif
#ifndef AUTO_POWER_CHAMBER_TEMP
#define AUTO_POWER_CHAMBER_TEMP 50
#endif
#ifndef AUTO_POWER_COOLER_TEMP
#define AUTO_POWER_COOLER_TEMP 50
#endif
#endif

#endif

/**
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -3577,6 +3577,8 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
#error "PSU_CONTROL requires PS_ON_PIN."
#elif POWER_OFF_DELAY < 0
#error "POWER_OFF_DELAY must be a positive value."
#elif ENABLED(POWER_OFF_WAIT_FOR_COOLDOWN) && !(defined(AUTO_POWER_E_TEMP) || defined(AUTO_POWER_CHAMBER_TEMP) || defined(AUTO_POWER_COOLER_TEMP))
#error "POWER_OFF_WAIT_FOR_COOLDOWN requires AUTO_POWER_E_TEMP, AUTO_POWER_CHAMBER_TEMP, and/or AUTO_POWER_COOLER_TEMP."
#endif
#endif

Expand Down

0 comments on commit 20eb3e9

Please sign in to comment.