diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 1f295a65a5..363a5e5003 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -179,6 +179,9 @@ void manage_inactivity(bool ignore_stepper_queue=false); #define disable_e3() /* nothing */ #endif +void enable_all_steppers(); +void disable_all_steppers(); + enum AxisEnum {X_AXIS=0, Y_AXIS=1, A_AXIS=0, B_AXIS=1, Z_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5}; //X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots. diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index a21fcbd741..8f8e69c85f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2569,13 +2569,7 @@ inline void gcode_G92() { */ inline void gcode_M17() { LCD_MESSAGEPGM(MSG_NO_MOVE); - enable_x(); - enable_y(); - enable_z(); - enable_e0(); - enable_e1(); - enable_e2(); - enable_e3(); + enable_all_steppers(); } #ifdef SDSUPPORT @@ -5695,7 +5689,17 @@ void handle_status_leds(void) { } #endif -void disable_all_axes() { +void enable_all_steppers() { + enable_x(); + enable_y(); + enable_z(); + enable_e0(); + enable_e1(); + enable_e2(); + enable_e3(); +} + +void disable_all_steppers() { disable_x(); disable_y(); disable_z(); @@ -5723,7 +5727,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { if (stepper_inactive_time && ms > previous_millis_cmd + stepper_inactive_time && !ignore_stepper_queue && !blocks_queued()) - disable_all_axes(); + disable_all_steppers(); #ifdef CHDK //Check if pin should be set to LOW after M240 set it to HIGH if (chdkActive && ms > chdkHigh + CHDK_DELAY) { @@ -5811,7 +5815,7 @@ void kill() cli(); // Stop interrupts disable_heater(); - disable_all_axes(); + disable_all_steppers(); #if HAS_POWER_SWITCH pinMode(PS_ON_PIN, INPUT); diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index d7d33c170e..8d8d2e3c4e 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -614,7 +614,7 @@ float junction_deviation = 0.1; #if EXTRUDERS > 1 case 1: enable_e1(); - g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE*2; + g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE * 2; if (g_uc_extruder_last_move[0] == 0) disable_e0(); #if EXTRUDERS > 2 if (g_uc_extruder_last_move[2] == 0) disable_e2(); @@ -626,7 +626,7 @@ float junction_deviation = 0.1; #if EXTRUDERS > 2 case 2: enable_e2(); - g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE*2; + g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE * 2; if (g_uc_extruder_last_move[0] == 0) disable_e0(); if (g_uc_extruder_last_move[1] == 0) disable_e1(); #if EXTRUDERS > 3 @@ -636,7 +636,7 @@ float junction_deviation = 0.1; #if EXTRUDERS > 3 case 3: enable_e3(); - g_uc_extruder_last_move[3] = BLOCK_BUFFER_SIZE*2; + g_uc_extruder_last_move[3] = BLOCK_BUFFER_SIZE * 2; if (g_uc_extruder_last_move[0] == 0) disable_e0(); if (g_uc_extruder_last_move[1] == 0) disable_e1(); if (g_uc_extruder_last_move[2] == 0) disable_e2(); diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 6f12bc9b22..ba4a4e9671 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -1127,13 +1127,7 @@ long st_get_position(uint8_t axis) { void finishAndDisableSteppers() { st_synchronize(); - disable_x(); - disable_y(); - disable_z(); - disable_e0(); - disable_e1(); - disable_e2(); - disable_e3(); + disable_all_steppers(); } void quickStop() { diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 5a8da94064..4afb8dc09a 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1051,13 +1051,7 @@ void setWatch() { thermal_runaway = true; for (;;) { disable_heater(); - disable_x(); - disable_y(); - disable_z(); - disable_e0(); - disable_e1(); - disable_e2(); - disable_e3(); + disable_all_steppers(); manage_heater(); lcd_update(); }