Skip to content

Commit

Permalink
Block during move in UBL mesh edit (MarlinFirmware#17670)
Browse files Browse the repository at this point in the history
  • Loading branch information
filippor authored and Alexander Yasnogor committed Aug 7, 2020
1 parent eb0d4c3 commit 9079942
Showing 1 changed file with 5 additions and 18 deletions.
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

0 comments on commit 9079942

Please sign in to comment.