Browse Source

This fix is not DELTA compatible

Scott Lahteine 8 years ago
parent
commit
664b299a51
4 changed files with 29 additions and 18 deletions
  1. 4
    1
      Marlin/Marlin.h
  2. 19
    15
      Marlin/Marlin_main.cpp
  3. 3
    1
      Marlin/endstops.cpp
  4. 3
    1
      Marlin/ultralcd.cpp

+ 4
- 1
Marlin/Marlin.h View File

@@ -225,9 +225,12 @@ void ok_to_send();
225 225
 
226 226
 void reset_bed_level();
227 227
 void prepare_move();
228
-void set_current_position_from_planner();
229 228
 void kill(const char*);
230 229
 
230
+#if DISABLED(DELTA) && DISABLED(SCARA)
231
+  void set_current_position_from_planner();
232
+#endif
233
+
231 234
 #if ENABLED(FILAMENT_RUNOUT_SENSOR)
232 235
   void handle_filament_runout();
233 236
 #endif

+ 19
- 15
Marlin/Marlin_main.cpp View File

@@ -5894,20 +5894,22 @@ inline void gcode_M400() { stepper.synchronize(); }
5894 5894
 
5895 5895
 #endif // FILAMENT_WIDTH_SENSOR
5896 5896
 
5897
-void set_current_position_from_planner() {
5898
-  stepper.synchronize();
5899
-  #if ENABLED(AUTO_BED_LEVELING_FEATURE)
5900
-    vector_3 pos = planner.adjusted_position(); // values directly from steppers...
5901
-    current_position[X_AXIS] = pos.x;
5902
-    current_position[Y_AXIS] = pos.y;
5903
-    current_position[Z_AXIS] = pos.z;
5904
-  #else
5905
-    current_position[X_AXIS] = stepper.get_axis_position_mm(X_AXIS);
5906
-    current_position[Y_AXIS] = stepper.get_axis_position_mm(Y_AXIS);
5907
-    current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS);
5908
-  #endif
5909
-  sync_plan_position();                       // ...re-apply to planner position
5910
-}
5897
+#if DISABLED(DELTA) && DISABLED(SCARA)
5898
+  void set_current_position_from_planner() {
5899
+    stepper.synchronize();
5900
+    #if ENABLED(AUTO_BED_LEVELING_FEATURE)
5901
+      vector_3 pos = planner.adjusted_position(); // values directly from steppers...
5902
+      current_position[X_AXIS] = pos.x;
5903
+      current_position[Y_AXIS] = pos.y;
5904
+      current_position[Z_AXIS] = pos.z;
5905
+    #else
5906
+      current_position[X_AXIS] = stepper.get_axis_position_mm(X_AXIS);
5907
+      current_position[Y_AXIS] = stepper.get_axis_position_mm(Y_AXIS);
5908
+      current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS);
5909
+    #endif
5910
+    sync_plan_position();                       // ...re-apply to planner position
5911
+  }
5912
+#endif
5911 5913
 
5912 5914
 /**
5913 5915
  * M410: Quickstop - Abort all planned moves
@@ -5917,7 +5919,9 @@ void set_current_position_from_planner() {
5917 5919
  */
5918 5920
 inline void gcode_M410() {
5919 5921
   stepper.quick_stop();
5920
-  set_current_position_from_planner();
5922
+  #if DISABLED(DELTA) && DISABLED(SCARA)
5923
+    set_current_position_from_planner();
5924
+  #endif
5921 5925
 }
5922 5926
 
5923 5927
 

+ 3
- 1
Marlin/endstops.cpp View File

@@ -187,7 +187,9 @@ void Endstops::report_state() {
187 187
         card.sdprinting = false;
188 188
         card.closefile();
189 189
         stepper.quick_stop();
190
-        set_current_position_from_planner();
190
+        #if DISABLED(DELTA) && DISABLED(SCARA)
191
+          set_current_position_from_planner();
192
+        #endif
191 193
         thermalManager.disable_all_heaters(); // switch off all heaters.
192 194
       }
193 195
     #endif

+ 3
- 1
Marlin/ultralcd.cpp View File

@@ -482,7 +482,9 @@ inline void line_to_current(AxisEnum axis) {
482 482
 
483 483
   static void lcd_sdcard_stop() {
484 484
     stepper.quick_stop();
485
-    set_current_position_from_planner();
485
+    #if DISABLED(DELTA) && DISABLED(SCARA)
486
+      set_current_position_from_planner();
487
+    #endif
486 488
     clear_command_queue();
487 489
     card.sdprinting = false;
488 490
     card.closefile();

Loading…
Cancel
Save