|
@@ -559,7 +559,7 @@ uint16_t max_display_update_time = 0;
|
559
|
559
|
if (no_reentry) return;
|
560
|
560
|
// Make this the current handler till all moves are done
|
561
|
561
|
no_reentry = true;
|
562
|
|
- screenFunc_t old_screen = currentScreen;
|
|
562
|
+ const screenFunc_t old_screen = currentScreen;
|
563
|
563
|
lcd_goto_screen(_lcd_synchronize);
|
564
|
564
|
stepper.synchronize();
|
565
|
565
|
no_reentry = false;
|
|
@@ -2336,6 +2336,19 @@ void kill_screen(const char* lcd_msg) {
|
2336
|
2336
|
void set_current_from_steppers_for_axis(const AxisEnum axis);
|
2337
|
2337
|
void sync_plan_position();
|
2338
|
2338
|
|
|
2339
|
+ void _lcd_do_nothing() {}
|
|
2340
|
+ void _lcd_hard_stop() {
|
|
2341
|
+ stepper.quick_stop();
|
|
2342
|
+ const screenFunc_t old_screen = currentScreen;
|
|
2343
|
+ currentScreen = _lcd_do_nothing;
|
|
2344
|
+ while (planner.movesplanned()) idle();
|
|
2345
|
+ currentScreen = old_screen;
|
|
2346
|
+ stepper.cleaning_buffer_counter = 0;
|
|
2347
|
+ set_current_from_steppers_for_axis(ALL_AXES);
|
|
2348
|
+ sync_plan_position();
|
|
2349
|
+ refresh_cmd_timeout();
|
|
2350
|
+ }
|
|
2351
|
+
|
2339
|
2352
|
void _lcd_ubl_output_map_lcd() {
|
2340
|
2353
|
static int16_t step_scaler = 0;
|
2341
|
2354
|
|
|
@@ -2380,15 +2393,10 @@ void kill_screen(const char* lcd_msg) {
|
2380
|
2393
|
if (lcdDrawUpdate) {
|
2381
|
2394
|
lcd_implementation_ubl_plot(x_plot, y_plot);
|
2382
|
2395
|
|
2383
|
|
- ubl_map_move_to_xy(); // Move to current location
|
|
2396
|
+ if (planner.movesplanned()) // If the nozzle is already moving, cancel the move.
|
|
2397
|
+ _lcd_hard_stop();
|
2384
|
2398
|
|
2385
|
|
- if (planner.movesplanned() > 1) { // if the nozzle is moving, cancel the move. There is a new location
|
2386
|
|
- stepper.quick_stop();
|
2387
|
|
- set_current_from_steppers_for_axis(ALL_AXES);
|
2388
|
|
- sync_plan_position();
|
2389
|
|
- ubl_map_move_to_xy(); // Move to new location
|
2390
|
|
- refresh_cmd_timeout();
|
2391
|
|
- }
|
|
2399
|
+ ubl_map_move_to_xy(); // Move to new location
|
2392
|
2400
|
}
|
2393
|
2401
|
}
|
2394
|
2402
|
|