Clean up LCD Manual Move / UBL Mesh Edit (#18373)
This commit is contained in:
@ -84,11 +84,7 @@
|
||||
_GRIDPOS(Y, 12), _GRIDPOS(Y, 13), _GRIDPOS(Y, 14), _GRIDPOS(Y, 15)
|
||||
);
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
bool unified_bed_leveling::lcd_map_control = false;
|
||||
#endif
|
||||
|
||||
volatile int unified_bed_leveling::encoder_diff;
|
||||
volatile int16_t unified_bed_leveling::encoder_diff;
|
||||
|
||||
unified_bed_leveling::unified_bed_leveling() {
|
||||
reset();
|
||||
|
@ -111,9 +111,12 @@ class unified_bed_leveling {
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
static bool lcd_map_control;
|
||||
static void steppers_were_disabled();
|
||||
#else
|
||||
static inline void steppers_were_disabled() {}
|
||||
#endif
|
||||
|
||||
static volatile int encoder_diff; // Volatile because it's changed at interrupt time.
|
||||
static volatile int16_t encoder_diff; // Volatile because buttons may changed it at interrupt time
|
||||
|
||||
unified_bed_leveling();
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user