Browse Source

disable steppers as routine in stepper.cpp

Bernhard 13 years ago
parent
commit
4d6a5c29df
3 changed files with 14 additions and 6 deletions
  1. 2
    6
      Marlin/Marlin.pde
  2. 10
    0
      Marlin/stepper.cpp
  3. 2
    0
      Marlin/stepper.h

+ 2
- 6
Marlin/Marlin.pde View File

@@ -641,6 +641,7 @@ inline void process_commands()
641 641
       //processed in write to file routine above
642 642
       //card,saving = false;
643 643
       break;
644
+      
644 645
     #endif //SDSUPPORT
645 646
 
646 647
     case 30: //M30 take time since the start of the SD print or an M109 command
@@ -832,12 +833,7 @@ inline void process_commands()
832 833
       }
833 834
       else
834 835
       { 
835
-        st_synchronize(); 
836
-        LCD_MESSAGEPGM("Free move.");
837
-        disable_x(); 
838
-        disable_y(); 
839
-        disable_z(); 
840
-        disable_e(); 
836
+        finishAndDisableSteppers();
841 837
       }
842 838
       break;
843 839
     case 85: // M85

+ 10
- 0
Marlin/stepper.cpp View File

@@ -702,3 +702,13 @@ long st_get_position(char axis)
702 702
   CRITICAL_SECTION_END;
703 703
   return count_pos;
704 704
 }
705
+
706
+void finishAndDisableSteppers()
707
+{
708
+  st_synchronize(); 
709
+  LCD_MESSAGEPGM("Released.");
710
+  disable_x(); 
711
+  disable_y(); 
712
+  disable_z(); 
713
+  disable_e(); 
714
+}

+ 2
- 0
Marlin/stepper.h View File

@@ -46,6 +46,8 @@ void endstops_hit_on_purpose(); //avoid creation of the message, i.e. after home
46 46
 
47 47
 void checkStepperErrors(); //Print errors detected by the stepper
48 48
 
49
+void finishAndDisableSteppers();
50
+
49 51
 extern block_t *current_block;  // A pointer to the block currently being traced
50 52
 
51 53
 

Loading…
Cancel
Save