|
@@ -2307,11 +2307,12 @@ void kill_screen(const char* lcd_msg) {
|
2307
|
2307
|
|
2308
|
2308
|
void _lcd_ubl_map_homing() {
|
2309
|
2309
|
defer_return_to_status = true;
|
2310
|
|
- ubl.lcd_map_control = true; // Return to the map screen
|
2311
|
2310
|
if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT < 3 ? 0 : (LCD_HEIGHT > 4 ? 2 : 1), PSTR(MSG_LEVEL_BED_HOMING));
|
2312
|
2311
|
lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW;
|
2313
|
|
- if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
|
|
2312
|
+ if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) {
|
|
2313
|
+ ubl.lcd_map_control = true; // Return to the map screen
|
2314
|
2314
|
lcd_goto_screen(_lcd_ubl_output_map_lcd);
|
|
2315
|
+ }
|
2315
|
2316
|
}
|
2316
|
2317
|
|
2317
|
2318
|
/**
|
|
@@ -2341,6 +2342,19 @@ void kill_screen(const char* lcd_msg) {
|
2341
|
2342
|
void set_current_from_steppers_for_axis(const AxisEnum axis);
|
2342
|
2343
|
void sync_plan_position();
|
2343
|
2344
|
|
|
2345
|
+ void _lcd_do_nothing() {}
|
|
2346
|
+ void _lcd_hard_stop() {
|
|
2347
|
+ stepper.quick_stop();
|
|
2348
|
+ const screenFunc_t old_screen = currentScreen;
|
|
2349
|
+ currentScreen = _lcd_do_nothing;
|
|
2350
|
+ while (planner.movesplanned()) idle();
|
|
2351
|
+ currentScreen = old_screen;
|
|
2352
|
+ stepper.cleaning_buffer_counter = 0;
|
|
2353
|
+ set_current_from_steppers_for_axis(ALL_AXES);
|
|
2354
|
+ sync_plan_position();
|
|
2355
|
+ gcode.refresh_cmd_timeout();
|
|
2356
|
+ }
|
|
2357
|
+
|
2344
|
2358
|
void _lcd_ubl_output_map_lcd() {
|
2345
|
2359
|
static int16_t step_scaler = 0;
|
2346
|
2360
|
|
|
@@ -2385,15 +2399,10 @@ void kill_screen(const char* lcd_msg) {
|
2385
|
2399
|
if (lcdDrawUpdate) {
|
2386
|
2400
|
lcd_implementation_ubl_plot(x_plot, y_plot);
|
2387
|
2401
|
|
2388
|
|
- ubl_map_move_to_xy(); // Move to current location
|
|
2402
|
+ if (planner.movesplanned()) // If the nozzle is already moving, cancel the move.
|
|
2403
|
+ _lcd_hard_stop();
|
2389
|
2404
|
|
2390
|
|
- if (planner.movesplanned() > 1) { // if the nozzle is moving, cancel the move. There is a new location
|
2391
|
|
- stepper.quick_stop();
|
2392
|
|
- set_current_from_steppers_for_axis(ALL_AXES);
|
2393
|
|
- sync_plan_position();
|
2394
|
|
- ubl_map_move_to_xy(); // Move to new location
|
2395
|
|
- gcode.refresh_cmd_timeout();
|
2396
|
|
- }
|
|
2405
|
+ ubl_map_move_to_xy(); // Move to new location
|
2397
|
2406
|
}
|
2398
|
2407
|
}
|
2399
|
2408
|
|