Browse Source

Allow disable of LCD_TIMEOUT_TO_STATUS (when 0)

Scott Lahteine 6 years ago
parent
commit
8014e1cc9d
1 changed files with 17 additions and 9 deletions
  1. 17
    9
      Marlin/src/lcd/ultralcd.cpp

+ 17
- 9
Marlin/src/lcd/ultralcd.cpp View File

@@ -600,7 +600,10 @@ void lcd_update() {
600 600
   static millis_t next_lcd_update_ms;
601 601
 
602 602
   #if HAS_LCD_MENU
603
-    static millis_t return_to_status_ms = 0;
603
+
604
+    #if LCD_TIMEOUT_TO_STATUS
605
+      static millis_t return_to_status_ms = 0;
606
+    #endif
604 607
 
605 608
     // Handle any queued Move Axis motion
606 609
     manage_manual_move();
@@ -692,8 +695,11 @@ void lcd_update() {
692 695
 
693 696
       #if ENABLED(ADC_KEYPAD)
694 697
 
695
-        if (handle_adc_keypad())
696
-          return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
698
+        if (handle_adc_keypad()) {
699
+          #if LCD_TIMEOUT_TO_STATUS
700
+            return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
701
+          #endif
702
+        }
697 703
 
698 704
       #elif ENABLED(REPRAPWORLD_KEYPAD)
699 705
 
@@ -736,7 +742,9 @@ void lcd_update() {
736 742
           encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP;
737 743
           encoderDiff = 0;
738 744
         }
739
-        return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
745
+        #if LCD_TIMEOUT_TO_STATUS
746
+          return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
747
+        #endif
740 748
         lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
741 749
       }
742 750
 
@@ -766,7 +774,9 @@ void lcd_update() {
766 774
         lcd_status_update_delay = 6;
767 775
         lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
768 776
         filename_scroll_pos++;
769
-        return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
777
+        #if LCD_TIMEOUT_TO_STATUS
778
+          return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
779
+        #endif
770 780
       }
771 781
     #endif
772 782
 
@@ -848,15 +858,13 @@ void lcd_update() {
848 858
       NOLESS(max_display_update_time, millis() - ms);
849 859
     }
850 860
 
851
-    #if HAS_LCD_MENU
852
-
861
+    #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS
853 862
       // Return to Status Screen after a timeout
854 863
       if (currentScreen == lcd_status_screen || defer_return_to_status)
855 864
         return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
856 865
       else if (ELAPSED(ms, return_to_status_ms))
857 866
         lcd_return_to_status();
858
-
859
-    #endif // HAS_LCD_MENU
867
+    #endif
860 868
 
861 869
     // Change state of drawing flag between screen updates
862 870
     if (!is_drawing) switch (lcdDrawUpdate) {

Loading…
Cancel
Save