Kaynağa Gözat

Fix, clarify LCD_TIMEOUT_TO_STATUS

Replaces #17887

Co-Authored-By: Daniel Callander <knifa@users.noreply.github.com>
Scott Lahteine 5 yıl önce
ebeveyn
işleme
7c26a54d3f

+ 4
- 4
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp Dosyayı Görüntüle

@@ -46,7 +46,7 @@ bool BaseScreen::buttonStyleCallback(CommandProcessor &cmd, uint8_t tag, uint8_t
46 46
     return false;
47 47
   }
48 48
 
49
-  #if LCD_TIMEOUT_TO_STATUS
49
+  #if LCD_TIMEOUT_TO_STATUS > 0
50 50
     if (EventLoop::get_pressed_tag() != 0) {
51 51
       reset_menu_timeout();
52 52
     }
@@ -66,7 +66,7 @@ bool BaseScreen::buttonStyleCallback(CommandProcessor &cmd, uint8_t tag, uint8_t
66 66
 }
67 67
 
68 68
 void BaseScreen::onIdle() {
69
-  #if LCD_TIMEOUT_TO_STATUS
69
+  #if LCD_TIMEOUT_TO_STATUS > 0
70 70
     if ((millis() - last_interaction) > LCD_TIMEOUT_TO_STATUS) {
71 71
       reset_menu_timeout();
72 72
       #if ENABLED(TOUCH_UI_DEBUG)
@@ -78,12 +78,12 @@ void BaseScreen::onIdle() {
78 78
 }
79 79
 
80 80
 void BaseScreen::reset_menu_timeout() {
81
-  #if LCD_TIMEOUT_TO_STATUS
81
+  #if LCD_TIMEOUT_TO_STATUS > 0
82 82
     last_interaction = millis();
83 83
   #endif
84 84
 }
85 85
 
86
-#if LCD_TIMEOUT_TO_STATUS
86
+#if LCD_TIMEOUT_TO_STATUS > 0
87 87
   uint32_t BaseScreen::last_interaction;
88 88
 #endif
89 89
 

+ 1
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h Dosyayı Görüntüle

@@ -103,7 +103,7 @@ enum {
103 103
 
104 104
 class BaseScreen : public UIScreen {
105 105
   protected:
106
-    #if LCD_TIMEOUT_TO_STATUS
106
+    #if LCD_TIMEOUT_TO_STATUS > 0
107 107
       static uint32_t last_interaction;
108 108
     #endif
109 109
 

+ 3
- 3
Marlin/src/lcd/ultralcd.cpp Dosyayı Görüntüle

@@ -121,7 +121,7 @@ MarlinUI ui;
121 121
   #endif
122 122
 #endif
123 123
 
124
-#if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS
124
+#if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS > 0
125 125
   bool MarlinUI::defer_return_to_status;
126 126
 #endif
127 127
 
@@ -732,7 +732,7 @@ void MarlinUI::update() {
732 732
   static uint16_t max_display_update_time = 0;
733 733
   millis_t ms = millis();
734 734
 
735
-  #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS
735
+  #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS > 0
736 736
     static millis_t return_to_status_ms = 0;
737 737
     #define RESET_STATUS_TIMEOUT() (return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS)
738 738
   #else
@@ -967,7 +967,7 @@ void MarlinUI::update() {
967 967
         NOLESS(max_display_update_time, millis() - ms);
968 968
     }
969 969
 
970
-    #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS
970
+    #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS > 0
971 971
       // Return to Status Screen after a timeout
972 972
       if (on_status_screen() || defer_return_to_status)
973 973
         RESET_STATUS_TIMEOUT();

+ 6
- 2
Marlin/src/lcd/ultralcd.h Dosyayı Görüntüle

@@ -508,7 +508,11 @@ public:
508 508
     #endif
509 509
 
510 510
     FORCE_INLINE static void defer_status_screen(const bool defer=true) {
511
-      TERN(LCD_TIMEOUT_TO_STATUS, defer_return_to_status = defer, UNUSED(defer));
511
+      #if LCD_TIMEOUT_TO_STATUS > 0
512
+        defer_return_to_status = defer;
513
+      #else
514
+        UNUSED(defer);
515
+      #endif
512 516
     }
513 517
 
514 518
     static inline void goto_previous_screen_no_defer() {
@@ -612,7 +616,7 @@ private:
612 616
 
613 617
   #if HAS_SPI_LCD
614 618
     #if HAS_LCD_MENU
615
-      #if LCD_TIMEOUT_TO_STATUS
619
+      #if LCD_TIMEOUT_TO_STATUS > 0
616 620
         static bool defer_return_to_status;
617 621
       #else
618 622
         static constexpr bool defer_return_to_status = false;

Loading…
İptal
Kaydet