Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 5 additions & 18 deletions Marlin/src/lcd/menu/menu_ubl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,16 +437,10 @@ void ubl_map_move_to_xy() {
void set_current_from_steppers_for_axis(const AxisEnum axis);
void sync_plan_position();

void _lcd_hard_stop() {
const screenFunc_t old_screen = ui.currentScreen;
lcd_limbo();
planner.quick_stop();
ui.currentScreen = old_screen;
set_current_from_steppers_for_axis(ALL_AXES);
sync_plan_position();
}

void _lcd_ubl_output_map_lcd() {

if (planner.movesplanned()) return;

static int16_t step_scaler = 0;

if (ui.use_click()) return _lcd_ubl_map_lcd_edit_cmd();
Expand All @@ -458,11 +452,7 @@ void _lcd_ubl_output_map_lcd() {
ui.refresh(LCDVIEW_REDRAW_NOW);
}

#if IS_KINEMATIC
#define KEEP_LOOPING true // Loop until a valid point is found
#else
#define KEEP_LOOPING false
#endif
#define KEEP_LOOPING ENABLED(IS_KINEMATIC) // Loop until a valid point is found

do {
// Encoder to the right (++)
Expand Down Expand Up @@ -495,10 +485,6 @@ void _lcd_ubl_output_map_lcd() {

if (ui.should_draw()) {
ui.ubl_plot(x_plot, y_plot);

if (planner.movesplanned()) // If the nozzle is already moving, cancel the move.
_lcd_hard_stop();

ubl_map_move_to_xy(); // Move to new location
}
}
Expand All @@ -511,6 +497,7 @@ void _lcd_ubl_output_map_lcd_cmd() {
set_all_unhomed();
queue.inject_P(G28_STR);
}
if (planner.movesplanned()) return;
ui.goto_screen(_lcd_ubl_map_homing);
}

Expand Down