Browse Source

🩹 Fix Color UI touchscreen sleep (#24826)

EvilGremlin 2 years ago
parent
commit
fcf9f22390
No account linked to committer's email address

+ 9
- 8
Marlin/src/lcd/marlinui.cpp View File

191
 
191
 
192
   uint8_t MarlinUI::sleep_timeout_minutes; // Initialized by settings.load()
192
   uint8_t MarlinUI::sleep_timeout_minutes; // Initialized by settings.load()
193
   millis_t MarlinUI::screen_timeout_millis = 0;
193
   millis_t MarlinUI::screen_timeout_millis = 0;
194
-  void MarlinUI::refresh_screen_timeout() {
195
-    screen_timeout_millis = sleep_timeout_minutes ? millis() + sleep_timeout_minutes * 60UL * 1000UL : 0;
196
-    sleep_display(false);
197
-  }
198
-
194
+  #if DISABLED(TFT_COLOR_UI)
195
+    void MarlinUI::refresh_screen_timeout() {
196
+      screen_timeout_millis = sleep_timeout_minutes ? millis() + sleep_timeout_minutes * 60UL * 1000UL : 0;
197
+      sleep_display(false);
198
+    }
199
+  #endif
199
 #endif
200
 #endif
200
 
201
 
201
 void MarlinUI::init() {
202
 void MarlinUI::init() {
1065
 
1066
 
1066
           #if LCD_BACKLIGHT_TIMEOUT_MINS
1067
           #if LCD_BACKLIGHT_TIMEOUT_MINS
1067
             refresh_backlight_timeout();
1068
             refresh_backlight_timeout();
1068
-          #elif HAS_DISPLAY_SLEEP
1069
+          #elif HAS_DISPLAY_SLEEP && DISABLED(TFT_COLOR_UI)
1069
             refresh_screen_timeout();
1070
             refresh_screen_timeout();
1070
           #endif
1071
           #endif
1071
 
1072
 
1178
           WRITE(LCD_BACKLIGHT_PIN, LOW); // Backlight off
1179
           WRITE(LCD_BACKLIGHT_PIN, LOW); // Backlight off
1179
           backlight_off_ms = 0;
1180
           backlight_off_ms = 0;
1180
         }
1181
         }
1181
-      #elif HAS_DISPLAY_SLEEP
1182
+      #elif HAS_DISPLAY_SLEEP && DISABLED(TFT_COLOR_UI)
1182
         if (screen_timeout_millis && ELAPSED(ms, screen_timeout_millis))
1183
         if (screen_timeout_millis && ELAPSED(ms, screen_timeout_millis))
1183
-          sleep_display();
1184
+          sleep_display(true);
1184
       #endif
1185
       #endif
1185
 
1186
 
1186
       // Change state of drawing flag between screen updates
1187
       // Change state of drawing flag between screen updates

+ 1
- 1
Marlin/src/lcd/menu/menu_configuration.cpp View File

550
   //
550
   //
551
   #if LCD_BACKLIGHT_TIMEOUT_MINS
551
   #if LCD_BACKLIGHT_TIMEOUT_MINS
552
     EDIT_ITEM(uint8, MSG_SCREEN_TIMEOUT, &ui.backlight_timeout_minutes, ui.backlight_timeout_min, ui.backlight_timeout_max, ui.refresh_backlight_timeout);
552
     EDIT_ITEM(uint8, MSG_SCREEN_TIMEOUT, &ui.backlight_timeout_minutes, ui.backlight_timeout_min, ui.backlight_timeout_max, ui.refresh_backlight_timeout);
553
-  #elif HAS_DISPLAY_SLEEP
553
+  #elif HAS_DISPLAY_SLEEP && DISABLED(TFT_COLOR_UI)
554
     EDIT_ITEM(uint8, MSG_SCREEN_TIMEOUT, &ui.sleep_timeout_minutes, ui.sleep_timeout_min, ui.sleep_timeout_max, ui.refresh_screen_timeout);
554
     EDIT_ITEM(uint8, MSG_SCREEN_TIMEOUT, &ui.sleep_timeout_minutes, ui.sleep_timeout_min, ui.sleep_timeout_max, ui.refresh_screen_timeout);
555
   #endif
555
   #endif
556
 
556
 

+ 2
- 2
Marlin/src/module/settings.cpp View File

642
 
642
 
643
   #if LCD_BACKLIGHT_TIMEOUT_MINS
643
   #if LCD_BACKLIGHT_TIMEOUT_MINS
644
     ui.refresh_backlight_timeout();
644
     ui.refresh_backlight_timeout();
645
-  #elif HAS_DISPLAY_SLEEP
645
+  #elif HAS_DISPLAY_SLEEP && DISABLED(TFT_COLOR_UI)
646
     ui.refresh_screen_timeout();
646
     ui.refresh_screen_timeout();
647
   #endif
647
   #endif
648
 }
648
 }
3167
   #if LCD_BACKLIGHT_TIMEOUT_MINS
3167
   #if LCD_BACKLIGHT_TIMEOUT_MINS
3168
     ui.backlight_timeout_minutes = LCD_BACKLIGHT_TIMEOUT_MINS;
3168
     ui.backlight_timeout_minutes = LCD_BACKLIGHT_TIMEOUT_MINS;
3169
   #elif HAS_DISPLAY_SLEEP
3169
   #elif HAS_DISPLAY_SLEEP
3170
-    ui.sleep_timeout_minutes = DISPLAY_SLEEP_MINUTES;
3170
+    ui.sleep_timeout_minutes = TERN(TOUCH_SCREEN, TOUCH_IDLE_SLEEP_MINS, DISPLAY_SLEEP_MINUTES);
3171
   #endif
3171
   #endif
3172
 
3172
 
3173
   //
3173
   //

Loading…
Cancel
Save