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
   static millis_t next_lcd_update_ms;
600
   static millis_t next_lcd_update_ms;
601
 
601
 
602
   #if HAS_LCD_MENU
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
     // Handle any queued Move Axis motion
608
     // Handle any queued Move Axis motion
606
     manage_manual_move();
609
     manage_manual_move();
692
 
695
 
693
       #if ENABLED(ADC_KEYPAD)
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
       #elif ENABLED(REPRAPWORLD_KEYPAD)
704
       #elif ENABLED(REPRAPWORLD_KEYPAD)
699
 
705
 
736
           encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP;
742
           encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP;
737
           encoderDiff = 0;
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
         lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
748
         lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
741
       }
749
       }
742
 
750
 
766
         lcd_status_update_delay = 6;
774
         lcd_status_update_delay = 6;
767
         lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
775
         lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
768
         filename_scroll_pos++;
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
     #endif
781
     #endif
772
 
782
 
848
       NOLESS(max_display_update_time, millis() - ms);
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
       // Return to Status Screen after a timeout
862
       // Return to Status Screen after a timeout
854
       if (currentScreen == lcd_status_screen || defer_return_to_status)
863
       if (currentScreen == lcd_status_screen || defer_return_to_status)
855
         return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
864
         return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
856
       else if (ELAPSED(ms, return_to_status_ms))
865
       else if (ELAPSED(ms, return_to_status_ms))
857
         lcd_return_to_status();
866
         lcd_return_to_status();
858
-
859
-    #endif // HAS_LCD_MENU
867
+    #endif
860
 
868
 
861
     // Change state of drawing flag between screen updates
869
     // Change state of drawing flag between screen updates
862
     if (!is_drawing) switch (lcdDrawUpdate) {
870
     if (!is_drawing) switch (lcdDrawUpdate) {

Loading…
Cancel
Save