Browse Source

Merge pull request #5887 from Roxy-3D/RCBugFix

Double Click of Encoder Wheel Jumps to Z-BabyStepping
Roxy-3D 8 years ago
parent
commit
11e892bd84
2 changed files with 32 additions and 2 deletions
  1. 11
    0
      Marlin/Configuration_adv.h
  2. 21
    2
      Marlin/ultralcd.cpp

+ 11
- 0
Marlin/Configuration_adv.h View File

@@ -1130,6 +1130,17 @@
1130 1130
 
1131 1131
 
1132 1132
 /**
1133
+ * Double Clicking of LCD Panel's Encoder Wheel while at the Status Screen will jump
1134
+ * to the Z-BabyStepping menu.
1135
+ */
1136
+//#define DOUBLE_CLICK_JUMPS_TO_Z_BABYSTEPPING
1137
+#define DOUBLE_CLICK_TIME_WINDOW 1250   // How quickly the double click must be done in miliseconds.
1138
+                                        // Please notice this time must be a little bit longer than what
1139
+                                        // is actually desired because there is some latency in detecting a
1140
+                                        // change in LCD Panel Button Status.
1141
+
1142
+
1143
+/**
1133 1144
  * Volumetric extrusion default state
1134 1145
  * Activate to make volumetric extrusion the default method,
1135 1146
  * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter.

+ 21
- 2
Marlin/ultralcd.cpp View File

@@ -49,6 +49,12 @@ int lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2
49 49
   millis_t previous_lcd_status_ms = 0;
50 50
 #endif
51 51
 
52
+#if ENABLED(BABYSTEPPING)
53
+  long babysteps_done = 0;
54
+  millis_t status_screen_click_time = 0;
55
+  static void lcd_babystep_z();
56
+#endif
57
+
52 58
 uint8_t lcd_status_message_level;
53 59
 char lcd_status_message[3 * (LCD_WIDTH) + 1] = WELCOME_MSG; // worst case is kana with up to 3*LCD_WIDTH+1
54 60
 
@@ -411,6 +417,21 @@ uint16_t max_display_update_time = 0;
411 417
    * General function to go directly to a screen
412 418
    */
413 419
   void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0) {
420
+    #ifdef DOUBLE_CLICK_JUMPS_TO_Z_BABYSTEPPING
421
+      #if ENABLED(BABYSTEPPING) 
422
+        if (currentScreen==lcd_status_screen && screen==lcd_main_menu)  // We are in leaving the status screen to goto the main_menu  
423
+          status_screen_click_time = millis();       // screen.  Mark the time so we know how quick the user is 
424
+                     // pressing buttons. 
425
+        if (currentScreen==lcd_main_menu)  { 
426
+          if ( screen==lcd_status_screen && status_screen_click_time+DOUBLE_CLICK_TIME_WINDOW>millis() ) { 
427
+            lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; 
428
+            status_screen_click_time = 0; 
429
+            lcd_babystep_z(); 
430
+          return; 
431
+          } 
432
+        } 
433
+      #endif 
434
+    #endif 
414 435
     if (currentScreen != screen) {
415 436
       currentScreen = screen;
416 437
       encoderPosition = encoder;
@@ -756,8 +777,6 @@ void kill_screen(const char* lcd_msg) {
756 777
 
757 778
   #if ENABLED(BABYSTEPPING)
758 779
 
759
-    long babysteps_done = 0;
760
-
761 780
     void _lcd_babystep(const AxisEnum axis, const char* msg) {
762 781
       if (lcd_clicked) { defer_return_to_status = false; return lcd_goto_previous_menu(); }
763 782
       ENCODER_DIRECTION_NORMAL();

Loading…
Cancel
Save