✨ Laser Safety Timeout (#24189)
This commit is contained in:
@@ -423,37 +423,38 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
|
||||
kill();
|
||||
}
|
||||
|
||||
const bool has_blocks = planner.has_blocks_queued(); // Any moves in the planner?
|
||||
if (has_blocks) gcode.reset_stepper_timeout(ms); // Reset timeout for M18/M84, M85 max 'kill', and laser.
|
||||
|
||||
// M18 / M84 : Handle steppers inactive time timeout
|
||||
if (gcode.stepper_inactive_time) {
|
||||
#if HAS_DISABLE_INACTIVE_AXIS
|
||||
if (gcode.stepper_inactive_time) {
|
||||
|
||||
static bool already_shutdown_steppers; // = false
|
||||
static bool already_shutdown_steppers; // = false
|
||||
|
||||
// Any moves in the planner? Resets both the M18/M84
|
||||
// activity timeout and the M85 max 'kill' timeout
|
||||
if (planner.has_blocks_queued())
|
||||
gcode.reset_stepper_timeout(ms);
|
||||
else if (!do_reset_timeout && gcode.stepper_inactive_timeout()) {
|
||||
if (!already_shutdown_steppers) {
|
||||
already_shutdown_steppers = true; // L6470 SPI will consume 99% of free time without this
|
||||
if (!has_blocks && !do_reset_timeout && gcode.stepper_inactive_timeout()) {
|
||||
if (!already_shutdown_steppers) {
|
||||
already_shutdown_steppers = true; // L6470 SPI will consume 99% of free time without this
|
||||
|
||||
// Individual axes will be disabled if configured
|
||||
TERN_(DISABLE_INACTIVE_X, stepper.disable_axis(X_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_Y, stepper.disable_axis(Y_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_Z, stepper.disable_axis(Z_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_I, stepper.disable_axis(I_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_J, stepper.disable_axis(J_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_K, stepper.disable_axis(K_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_U, stepper.disable_axis(U_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_V, stepper.disable_axis(V_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_W, stepper.disable_axis(W_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_E, stepper.disable_e_steppers());
|
||||
// Individual axes will be disabled if configured
|
||||
TERN_(DISABLE_INACTIVE_X, stepper.disable_axis(X_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_Y, stepper.disable_axis(Y_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_Z, stepper.disable_axis(Z_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_I, stepper.disable_axis(I_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_J, stepper.disable_axis(J_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_K, stepper.disable_axis(K_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_U, stepper.disable_axis(U_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_V, stepper.disable_axis(V_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_W, stepper.disable_axis(W_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_E, stepper.disable_e_steppers());
|
||||
|
||||
TERN_(AUTO_BED_LEVELING_UBL, bedlevel.steppers_were_disabled());
|
||||
TERN_(AUTO_BED_LEVELING_UBL, bedlevel.steppers_were_disabled());
|
||||
}
|
||||
}
|
||||
else
|
||||
already_shutdown_steppers = false;
|
||||
}
|
||||
else
|
||||
already_shutdown_steppers = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLED(PHOTO_GCODE) && PIN_EXISTS(CHDK)
|
||||
// Check if CHDK should be set to LOW (after M240 set it HIGH)
|
||||
|
||||
Reference in New Issue
Block a user