🐛 Fix SEGMENT_LEVELED_MOVES with UBL

This commit is contained in:
Scott Lahteine 2022-05-22 16:53:12 -05:00
parent c97cf10956
commit 1d12e72bf6
2 changed files with 9 additions and 8 deletions

View file

@ -1002,7 +1002,7 @@
*/
#if ENABLED(AUTO_BED_LEVELING_UBL)
#undef LCD_BED_LEVELING
#if ENABLED(DELTA)
#if EITHER(DELTA, SEGMENT_LEVELED_MOVES)
#define UBL_SEGMENTED 1
#endif
#endif

View file

@ -867,8 +867,6 @@ void restore_feedrate_and_scaling() {
#endif // !HAS_SOFTWARE_ENDSTOPS
#if !UBL_SEGMENTED
FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
const millis_t ms = millis();
if (ELAPSED(ms, next_idle_ms)) {
@ -985,7 +983,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
#else // !IS_KINEMATIC
#if ENABLED(SEGMENT_LEVELED_MOVES)
#if ENABLED(SEGMENT_LEVELED_MOVES) && DISABLED(AUTO_BED_LEVELING_UBL)
/**
* Prepare a segmented move on a CARTESIAN setup.
@ -1045,7 +1043,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
planner.buffer_line(destination, fr_mm_s, active_extruder, cartesian_segment_mm OPTARG(SCARA_FEEDRATE_SCALING, inv_duration));
}
#endif // SEGMENT_LEVELED_MOVES
#endif // SEGMENT_LEVELED_MOVES && !AUTO_BED_LEVELING_UBL
/**
* Prepare a linear move in a Cartesian setup.
@ -1060,8 +1058,12 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
#if HAS_MESH
if (planner.leveling_active && planner.leveling_active_at_z(destination.z)) {
#if ENABLED(AUTO_BED_LEVELING_UBL)
#if UBL_SEGMENTED
return bedlevel.line_to_destination_segmented(scaled_fr_mm_s);
#else
bedlevel.line_to_destination_cartesian(scaled_fr_mm_s, active_extruder); // UBL's motion routine needs to know about
return true; // all moves, including Z-only moves.
#endif
#elif ENABLED(SEGMENT_LEVELED_MOVES)
segmented_line_to_destination(scaled_fr_mm_s);
return false; // caller will update current_position
@ -1087,7 +1089,6 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
}
#endif // !IS_KINEMATIC
#endif // !UBL_SEGMENTED
#if HAS_DUPLICATION_MODE
bool extruder_duplication_enabled;