Clean up LCD Manual Move / UBL Mesh Edit (#18373)

This commit is contained in:
Scott Lahteine
2020-07-03 09:53:22 -05:00
committed by GitHub
parent 2c15a787c7
commit f6a2b64091
14 changed files with 265 additions and 208 deletions

View File

@@ -54,7 +54,18 @@
#define UBL_G29_P31
#if HAS_LCD_MENU
void _lcd_ubl_output_map_lcd();
bool unified_bed_leveling::lcd_map_control = false;
void unified_bed_leveling::steppers_were_disabled() {
if (lcd_map_control) {
lcd_map_control = false;
ui.defer_status_screen(false);
}
}
void ubl_map_screen();
#endif
#define SIZE_OF_LITTLE_RAISE 1
@@ -789,11 +800,11 @@
bool click_and_hold(const clickFunc_t func=nullptr) {
if (ui.button_pressed()) {
ui.quick_feedback(false); // Preserve button state for click-and-hold
ui.quick_feedback(false); // Preserve button state for click-and-hold
const millis_t nxt = millis() + 1500UL;
while (ui.button_pressed()) { // Loop while the encoder is pressed. Uses hardware flag!
idle(); // idle, of course
if (ELAPSED(millis(), nxt)) { // After 1.5 seconds
while (ui.button_pressed()) { // Loop while the encoder is pressed. Uses hardware flag!
idle(); // idle, of course
if (ELAPSED(millis(), nxt)) { // After 1.5 seconds
ui.quick_feedback();
if (func) (*func)();
ui.wait_for_release();
@@ -995,9 +1006,9 @@
lcd_mesh_edit_setup(new_z);
do {
idle();
new_z = lcd_mesh_edit();
TERN_(UBL_MESH_EDIT_MOVES_Z, do_blocking_move_to_z(h_offset + new_z)); // Move the nozzle as the point is edited
idle();
SERIAL_FLUSH(); // Prevent host M105 buffer overrun.
} while (!ui.button_pressed());
@@ -1022,7 +1033,7 @@
SERIAL_ECHOLNPGM("Done Editing Mesh");
if (lcd_map_control)
ui.goto_screen(_lcd_ubl_output_map_lcd);
ui.goto_screen(ubl_map_screen);
else
ui.return_to_status();
}