Skip to content

Commit a93146b

Browse files
committed
🐛 Fix SEGMENT_LEVELED_MOVES with UBL
1 parent d99185b commit a93146b

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Marlin/src/inc/Conditionals_LCD.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@
12411241
*/
12421242
#if ENABLED(AUTO_BED_LEVELING_UBL)
12431243
#undef LCD_BED_LEVELING
1244-
#if ENABLED(DELTA)
1244+
#if EITHER(DELTA, SEGMENT_LEVELED_MOVES)
12451245
#define UBL_SEGMENTED 1
12461246
#endif
12471247
#endif

Marlin/src/module/motion.cpp

+8-7
Original file line numberDiff line numberDiff line change
@@ -960,8 +960,6 @@ void restore_feedrate_and_scaling() {
960960

961961
#endif // !HAS_SOFTWARE_ENDSTOPS
962962

963-
#if !UBL_SEGMENTED
964-
965963
FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
966964
const millis_t ms = millis();
967965
if (ELAPSED(ms, next_idle_ms)) {
@@ -1078,7 +1076,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
10781076

10791077
#else // !IS_KINEMATIC
10801078

1081-
#if ENABLED(SEGMENT_LEVELED_MOVES)
1079+
#if ENABLED(SEGMENT_LEVELED_MOVES) && DISABLED(AUTO_BED_LEVELING_UBL)
10821080

10831081
/**
10841082
* Prepare a segmented move on a CARTESIAN setup.
@@ -1138,7 +1136,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
11381136
planner.buffer_line(destination, fr_mm_s, active_extruder, cartesian_segment_mm OPTARG(SCARA_FEEDRATE_SCALING, inv_duration));
11391137
}
11401138

1141-
#endif // SEGMENT_LEVELED_MOVES
1139+
#endif // SEGMENT_LEVELED_MOVES && !AUTO_BED_LEVELING_UBL
11421140

11431141
/**
11441142
* Prepare a linear move in a Cartesian setup.
@@ -1153,8 +1151,12 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
11531151
#if HAS_MESH
11541152
if (planner.leveling_active && planner.leveling_active_at_z(destination.z)) {
11551153
#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
11581160
#elif ENABLED(SEGMENT_LEVELED_MOVES)
11591161
segmented_line_to_destination(scaled_fr_mm_s);
11601162
return false; // caller will update current_position
@@ -1180,7 +1182,6 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
11801182
}
11811183

11821184
#endif // !IS_KINEMATIC
1183-
#endif // !UBL_SEGMENTED
11841185

11851186
#if HAS_DUPLICATION_MODE
11861187
bool extruder_duplication_enabled;

0 commit comments

Comments
 (0)