Browse Source

Double Click of Encoder Wheel Jumps to Z-BabyStepping

Roxy-3D 8 years ago
parent
commit
17d1cd7c09
1 changed files with 15 additions and 2 deletions
  1. 15
    2
      Marlin/ultralcd.cpp

+ 15
- 2
Marlin/ultralcd.cpp View File

@@ -411,6 +411,21 @@ uint16_t max_display_update_time = 0;
411 411
    * General function to go directly to a screen
412 412
    */
413 413
   void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0) {
414
+  #ifdef DOUBLE_CLICK_JUMPS_TO_Z_BABYSTEPPING
415
+  #if ENABLED(BABYSTEPPING)
416
+    if (currentScreen==lcd_status_screen && screen==lcd_main_menu)	// We are in leaving the status screen to goto the main_menu 
417
+      status_screen_click_time = millis();				// screen.  Mark the time so we know how quick the user is
418
+									// pressing buttons.
419
+    if (currentScreen==lcd_main_menu)  {
420
+      if ( screen==lcd_status_screen && status_screen_click_time+DOUBLE_CLICK_TIME_WINDOW>millis() ) {
421
+        lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW;
422
+        status_screen_click_time = 0;
423
+        lcd_babystep_z();
424
+        return;
425
+      }
426
+    }
427
+  #endif
428
+  #endif
414 429
     if (currentScreen != screen) {
415 430
       currentScreen = screen;
416 431
       encoderPosition = encoder;
@@ -756,8 +771,6 @@ void kill_screen(const char* lcd_msg) {
756 771
 
757 772
   #if ENABLED(BABYSTEPPING)
758 773
 
759
-    long babysteps_done = 0;
760
-
761 774
     void _lcd_babystep(const AxisEnum axis, const char* msg) {
762 775
       if (lcd_clicked) { defer_return_to_status = false; return lcd_goto_previous_menu(); }
763 776
       ENCODER_DIRECTION_NORMAL();

Loading…
Cancel
Save