浏览代码

Fix, clarify LCD_TIMEOUT_TO_STATUS

Replaces #17887

Co-Authored-By: Daniel Callander <knifa@users.noreply.github.com>
Scott Lahteine 5 年前
父节点
当前提交
7c26a54d3f

+ 4
- 4
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp 查看文件

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

+ 1
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h 查看文件

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

+ 3
- 3
Marlin/src/lcd/ultralcd.cpp 查看文件

121
   #endif
121
   #endif
122
 #endif
122
 #endif
123
 
123
 
124
-#if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS
124
+#if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS > 0
125
   bool MarlinUI::defer_return_to_status;
125
   bool MarlinUI::defer_return_to_status;
126
 #endif
126
 #endif
127
 
127
 
732
   static uint16_t max_display_update_time = 0;
732
   static uint16_t max_display_update_time = 0;
733
   millis_t ms = millis();
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
     static millis_t return_to_status_ms = 0;
736
     static millis_t return_to_status_ms = 0;
737
     #define RESET_STATUS_TIMEOUT() (return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS)
737
     #define RESET_STATUS_TIMEOUT() (return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS)
738
   #else
738
   #else
967
         NOLESS(max_display_update_time, millis() - ms);
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
       // Return to Status Screen after a timeout
971
       // Return to Status Screen after a timeout
972
       if (on_status_screen() || defer_return_to_status)
972
       if (on_status_screen() || defer_return_to_status)
973
         RESET_STATUS_TIMEOUT();
973
         RESET_STATUS_TIMEOUT();

+ 6
- 2
Marlin/src/lcd/ultralcd.h 查看文件

508
     #endif
508
     #endif
509
 
509
 
510
     FORCE_INLINE static void defer_status_screen(const bool defer=true) {
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
     static inline void goto_previous_screen_no_defer() {
518
     static inline void goto_previous_screen_no_defer() {
612
 
616
 
613
   #if HAS_SPI_LCD
617
   #if HAS_SPI_LCD
614
     #if HAS_LCD_MENU
618
     #if HAS_LCD_MENU
615
-      #if LCD_TIMEOUT_TO_STATUS
619
+      #if LCD_TIMEOUT_TO_STATUS > 0
616
         static bool defer_return_to_status;
620
         static bool defer_return_to_status;
617
       #else
621
       #else
618
         static constexpr bool defer_return_to_status = false;
622
         static constexpr bool defer_return_to_status = false;

正在加载...
取消
保存