diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index 60ec2b22e5..d94f810c1d 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -641,6 +641,7 @@ inline void process_commands() //processed in write to file routine above //card,saving = false; break; + #endif //SDSUPPORT case 30: //M30 take time since the start of the SD print or an M109 command @@ -832,12 +833,7 @@ inline void process_commands() } else { - st_synchronize(); - LCD_MESSAGEPGM("Free move."); - disable_x(); - disable_y(); - disable_z(); - disable_e(); + finishAndDisableSteppers(); } break; case 85: // M85 diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 0c3f0ee1bd..491b6e7f2b 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -702,3 +702,13 @@ long st_get_position(char axis) CRITICAL_SECTION_END; return count_pos; } + +void finishAndDisableSteppers() +{ + st_synchronize(); + LCD_MESSAGEPGM("Released."); + disable_x(); + disable_y(); + disable_z(); + disable_e(); +} diff --git a/Marlin/stepper.h b/Marlin/stepper.h index 97f72bf2ed..73b7efb1cd 100644 --- a/Marlin/stepper.h +++ b/Marlin/stepper.h @@ -46,6 +46,8 @@ void endstops_hit_on_purpose(); //avoid creation of the message, i.e. after home void checkStepperErrors(); //Print errors detected by the stepper +void finishAndDisableSteppers(); + extern block_t *current_block; // A pointer to the block currently being traced