|
@@ -33,6 +33,10 @@
|
33
|
33
|
#include "../module/stepper/indirection.h"
|
34
|
34
|
#include "../MarlinCore.h"
|
35
|
35
|
|
|
36
|
+#if defined(PSU_POWERUP_GCODE) || defined(PSU_POWEROFF_GCODE)
|
|
37
|
+ #include "../gcode/gcode.h"
|
|
38
|
+#endif
|
|
39
|
+
|
36
|
40
|
#if BOTH(USE_CONTROLLER_FAN, AUTO_POWER_CONTROLLERFAN)
|
37
|
41
|
#include "controllerfan.h"
|
38
|
42
|
#endif
|
|
@@ -107,11 +111,19 @@ void Power::power_on() {
|
107
|
111
|
safe_delay(PSU_POWERUP_DELAY);
|
108
|
112
|
restore_stepper_drivers();
|
109
|
113
|
TERN_(HAS_TRINAMIC_CONFIG, safe_delay(PSU_POWERUP_DELAY));
|
|
114
|
+ #ifdef PSU_POWERUP_GCODE
|
|
115
|
+ GcodeSuite::process_subcommands_now_P(PSTR(PSU_POWERUP_GCODE));
|
|
116
|
+ #endif
|
110
|
117
|
}
|
111
|
118
|
}
|
112
|
119
|
|
113
|
120
|
void Power::power_off() {
|
114
|
|
- if (powersupply_on) PSU_PIN_OFF();
|
|
121
|
+ if (powersupply_on) {
|
|
122
|
+ #ifdef PSU_POWEROFF_GCODE
|
|
123
|
+ GcodeSuite::process_subcommands_now_P(PSTR(PSU_POWEROFF_GCODE));
|
|
124
|
+ #endif
|
|
125
|
+ PSU_PIN_OFF();
|
|
126
|
+ }
|
115
|
127
|
}
|
116
|
128
|
|
117
|
129
|
#endif // AUTO_POWER_CONTROL
|