From 17d1cd7c09ea4d0f94b721587a9e111747d83d89 Mon Sep 17 00:00:00 2001 From: Roxy-3D Date: Tue, 21 Feb 2017 18:08:19 -0700 Subject: [PATCH] Double Click of Encoder Wheel Jumps to Z-BabyStepping --- Marlin/ultralcd.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 5e4012ac26..70e776bc76 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -411,6 +411,21 @@ uint16_t max_display_update_time = 0; * General function to go directly to a screen */ void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0) { + #ifdef DOUBLE_CLICK_JUMPS_TO_Z_BABYSTEPPING + #if ENABLED(BABYSTEPPING) + if (currentScreen==lcd_status_screen && screen==lcd_main_menu) // We are in leaving the status screen to goto the main_menu + status_screen_click_time = millis(); // screen. Mark the time so we know how quick the user is + // pressing buttons. + if (currentScreen==lcd_main_menu) { + if ( screen==lcd_status_screen && status_screen_click_time+DOUBLE_CLICK_TIME_WINDOW>millis() ) { + lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; + status_screen_click_time = 0; + lcd_babystep_z(); + return; + } + } + #endif + #endif if (currentScreen != screen) { currentScreen = screen; encoderPosition = encoder; @@ -756,8 +771,6 @@ void kill_screen(const char* lcd_msg) { #if ENABLED(BABYSTEPPING) - long babysteps_done = 0; - void _lcd_babystep(const AxisEnum axis, const char* msg) { if (lcd_clicked) { defer_return_to_status = false; return lcd_goto_previous_menu(); } ENCODER_DIRECTION_NORMAL();