|
@@ -5889,13 +5889,31 @@ inline void gcode_M400() { stepper.synchronize(); }
|
5889
|
5889
|
|
5890
|
5890
|
#endif // FILAMENT_WIDTH_SENSOR
|
5891
|
5891
|
|
|
5892
|
+void set_current_position_from_planner() {
|
|
5893
|
+ stepper.synchronize();
|
|
5894
|
+ #if ENABLED(AUTO_BED_LEVELING_FEATURE)
|
|
5895
|
+ vector_3 pos = planner.adjusted_position(); // values directly from steppers...
|
|
5896
|
+ current_position[X_AXIS] = pos.x;
|
|
5897
|
+ current_position[Y_AXIS] = pos.y;
|
|
5898
|
+ current_position[Z_AXIS] = pos.z;
|
|
5899
|
+ #else
|
|
5900
|
+ current_position[X_AXIS] = stepper.get_axis_position_mm(X_AXIS);
|
|
5901
|
+ current_position[Y_AXIS] = stepper.get_axis_position_mm(Y_AXIS);
|
|
5902
|
+ current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS);
|
|
5903
|
+ #endif
|
|
5904
|
+ sync_plan_position(); // ...re-apply to planner position
|
|
5905
|
+}
|
|
5906
|
+
|
5892
|
5907
|
/**
|
5893
|
5908
|
* M410: Quickstop - Abort all planned moves
|
5894
|
5909
|
*
|
5895
|
5910
|
* This will stop the carriages mid-move, so most likely they
|
5896
|
5911
|
* will be out of sync with the stepper position after this.
|
5897
|
5912
|
*/
|
5898
|
|
-inline void gcode_M410() { stepper.quick_stop(); }
|
|
5913
|
+inline void gcode_M410() {
|
|
5914
|
+ stepper.quick_stop();
|
|
5915
|
+ set_current_position_from_planner();
|
|
5916
|
+}
|
5899
|
5917
|
|
5900
|
5918
|
|
5901
|
5919
|
#if ENABLED(MESH_BED_LEVELING)
|