Browse Source

🐛 Fix SEGMENT_LEVELED_MOVES with UBL

Scott Lahteine 2 years ago
parent
commit
a93146b71d
2 changed files with 9 additions and 8 deletions
  1. 1
    1
      Marlin/src/inc/Conditionals_LCD.h
  2. 8
    7
      Marlin/src/module/motion.cpp

+ 1
- 1
Marlin/src/inc/Conditionals_LCD.h View File

@@ -1241,7 +1241,7 @@
1241 1241
  */
1242 1242
 #if ENABLED(AUTO_BED_LEVELING_UBL)
1243 1243
   #undef LCD_BED_LEVELING
1244
-  #if ENABLED(DELTA)
1244
+  #if EITHER(DELTA, SEGMENT_LEVELED_MOVES)
1245 1245
     #define UBL_SEGMENTED 1
1246 1246
   #endif
1247 1247
 #endif

+ 8
- 7
Marlin/src/module/motion.cpp View File

@@ -960,8 +960,6 @@ void restore_feedrate_and_scaling() {
960 960
 
961 961
 #endif // !HAS_SOFTWARE_ENDSTOPS
962 962
 
963
-#if !UBL_SEGMENTED
964
-
965 963
 FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
966 964
   const millis_t ms = millis();
967 965
   if (ELAPSED(ms, next_idle_ms)) {
@@ -1078,7 +1076,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
1078 1076
 
1079 1077
 #else // !IS_KINEMATIC
1080 1078
 
1081
-  #if ENABLED(SEGMENT_LEVELED_MOVES)
1079
+  #if ENABLED(SEGMENT_LEVELED_MOVES) && DISABLED(AUTO_BED_LEVELING_UBL)
1082 1080
 
1083 1081
     /**
1084 1082
      * Prepare a segmented move on a CARTESIAN setup.
@@ -1138,7 +1136,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
1138 1136
       planner.buffer_line(destination, fr_mm_s, active_extruder, cartesian_segment_mm OPTARG(SCARA_FEEDRATE_SCALING, inv_duration));
1139 1137
     }
1140 1138
 
1141
-  #endif // SEGMENT_LEVELED_MOVES
1139
+  #endif // SEGMENT_LEVELED_MOVES && !AUTO_BED_LEVELING_UBL
1142 1140
 
1143 1141
   /**
1144 1142
    * Prepare a linear move in a Cartesian setup.
@@ -1153,8 +1151,12 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
1153 1151
     #if HAS_MESH
1154 1152
       if (planner.leveling_active && planner.leveling_active_at_z(destination.z)) {
1155 1153
         #if ENABLED(AUTO_BED_LEVELING_UBL)
1156
-          bedlevel.line_to_destination_cartesian(scaled_fr_mm_s, active_extruder); // UBL's motion routine needs to know about
1157
-          return true;                                                        // all moves, including Z-only moves.
1154
+          #if UBL_SEGMENTED
1155
+            return bedlevel.line_to_destination_segmented(scaled_fr_mm_s);
1156
+          #else
1157
+            bedlevel.line_to_destination_cartesian(scaled_fr_mm_s, active_extruder); // UBL's motion routine needs to know about
1158
+            return true;                                                             // all moves, including Z-only moves.
1159
+          #endif
1158 1160
         #elif ENABLED(SEGMENT_LEVELED_MOVES)
1159 1161
           segmented_line_to_destination(scaled_fr_mm_s);
1160 1162
           return false; // caller will update current_position
@@ -1180,7 +1182,6 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
1180 1182
   }
1181 1183
 
1182 1184
 #endif // !IS_KINEMATIC
1183
-#endif // !UBL_SEGMENTED
1184 1185
 
1185 1186
 #if HAS_DUPLICATION_MODE
1186 1187
   bool extruder_duplication_enabled;

Loading…
Cancel
Save