Block during move in UBL mesh edit (#17670)

This commit is contained in:
FilippoR 2020-04-28 06:35:10 +02:00 committed by GitHub
parent 630b4ecfff
commit 9fa5119333
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23

View file

@ -437,16 +437,10 @@ void ubl_map_move_to_xy() {
void set_current_from_steppers_for_axis(const AxisEnum axis); void set_current_from_steppers_for_axis(const AxisEnum axis);
void sync_plan_position(); 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() { void _lcd_ubl_output_map_lcd() {
if (planner.movesplanned()) return;
static int16_t step_scaler = 0; static int16_t step_scaler = 0;
if (ui.use_click()) return _lcd_ubl_map_lcd_edit_cmd(); if (ui.use_click()) return _lcd_ubl_map_lcd_edit_cmd();
@ -458,11 +452,7 @@ void _lcd_ubl_output_map_lcd() {
ui.refresh(LCDVIEW_REDRAW_NOW); ui.refresh(LCDVIEW_REDRAW_NOW);
} }
#if IS_KINEMATIC #define KEEP_LOOPING ENABLED(IS_KINEMATIC) // Loop until a valid point is found
#define KEEP_LOOPING true // Loop until a valid point is found
#else
#define KEEP_LOOPING false
#endif
do { do {
// Encoder to the right (++) // Encoder to the right (++)
@ -495,10 +485,6 @@ void _lcd_ubl_output_map_lcd() {
if (ui.should_draw()) { if (ui.should_draw()) {
ui.ubl_plot(x_plot, y_plot); 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 ubl_map_move_to_xy(); // Move to new location
} }
} }
@ -511,6 +497,7 @@ void _lcd_ubl_output_map_lcd_cmd() {
set_all_unhomed(); set_all_unhomed();
queue.inject_P(G28_STR); queue.inject_P(G28_STR);
} }
if (planner.movesplanned()) return;
ui.goto_screen(_lcd_ubl_map_homing); ui.goto_screen(_lcd_ubl_map_homing);
} }