Browse Source

🩹 Fix LCD_BACKLIGHT_TIMEOUT compile (#24463)

Jason Smith 1 year ago
parent
commit
f65f7a685b
No account linked to committer's email address

+ 1
- 1
Marlin/src/gcode/gcode.h View File

@@ -886,7 +886,7 @@ private:
886 886
     static void M250_report(const bool forReplay=true);
887 887
   #endif
888 888
 
889
-  #if HAS_DISPLAY_SLEEP
889
+  #if HAS_GCODE_M255
890 890
     static void M255();
891 891
     static void M255_report(const bool forReplay=true);
892 892
   #endif

+ 1
- 1
Marlin/src/gcode/lcd/M255.cpp View File

@@ -36,7 +36,7 @@ void GcodeSuite::M255() {
36 36
       const int m = parser.value_int();
37 37
       ui.sleep_timeout_minutes = constrain(m, SLEEP_TIMEOUT_MIN, SLEEP_TIMEOUT_MAX);
38 38
     #else
39
-      const int s = parser.value_int() * 60;
39
+      const unsigned int s = parser.value_ushort() * 60;
40 40
       ui.lcd_backlight_timeout = constrain(s, LCD_BKL_TIMEOUT_MIN, LCD_BKL_TIMEOUT_MAX);
41 41
     #endif
42 42
   }

+ 4
- 0
Marlin/src/inc/Conditionals_adv.h View File

@@ -591,6 +591,10 @@
591 591
   #define HAS_PRINT_PROGRESS 1
592 592
 #endif
593 593
 
594
+#if ANY(HAS_MARLINUI_MENU, ULTIPANEL_FEEDMULTIPLY, SOFT_RESET_ON_KILL)
595
+  #define HAS_ENCODER_ACTION 1
596
+#endif
597
+
594 598
 #if STATUS_MESSAGE_TIMEOUT_SEC > 0
595 599
   #define HAS_STATUS_MESSAGE_TIMEOUT 1
596 600
 #endif

+ 2
- 6
Marlin/src/lcd/marlinui.h View File

@@ -32,10 +32,6 @@
32 32
   #include "tft_io/touch_calibration.h"
33 33
 #endif
34 34
 
35
-#if ANY(HAS_MARLINUI_MENU, ULTIPANEL_FEEDMULTIPLY, SOFT_RESET_ON_KILL)
36
-  #define HAS_ENCODER_ACTION 1
37
-#endif
38
-
39 35
 #if E_MANUAL > 1
40 36
   #define MULTI_E_MANUAL 1
41 37
 #endif
@@ -271,8 +267,8 @@ public:
271 267
   #endif
272 268
 
273 269
   #if LCD_BACKLIGHT_TIMEOUT
274
-    #define LCD_BKL_TIMEOUT_MIN 1
275
-    #define LCD_BKL_TIMEOUT_MAX (60*60*18) // 18 hours max within uint16_t
270
+    #define LCD_BKL_TIMEOUT_MIN 1u
271
+    #define LCD_BKL_TIMEOUT_MAX UINT16_MAX // Slightly more than 18 hours
276 272
     static uint16_t lcd_backlight_timeout;
277 273
     static millis_t backlight_off_ms;
278 274
     static void refresh_backlight_timeout();

+ 5
- 4
buildroot/tests/mega2560 View File

@@ -206,16 +206,17 @@ opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOO
206 206
 exec_test $1 $2 "MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Laser Safety Timeout | Flowmeter | 44780 LCD " "$3"
207 207
 
208 208
 #
209
-# Test redundant temperature sensors + MAX TC
209
+# Test redundant temperature sensors + MAX TC + Backlight Timeout
210 210
 #
211 211
 restore_configs
212 212
 opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 1 \
213 213
         TEMP_SENSOR_0 -2 TEMP_SENSOR_REDUNDANT -2 \
214 214
         TEMP_SENSOR_REDUNDANT_SOURCE E1 TEMP_SENSOR_REDUNDANT_TARGET E0 \
215
-        TEMP_0_CS_PIN 11 TEMP_1_CS_PIN 12
216
-opt_enable MPCTEMP
215
+        TEMP_0_CS_PIN 11 TEMP_1_CS_PIN 12 \
216
+        LCD_BACKLIGHT_TIMEOUT 30
217
+opt_enable MPCTEMP MINIPANEL
217 218
 opt_disable PIDTEMP
218
-exec_test $1 $2 "MEGA2560 RAMPS | Redundant temperature sensor | 2x MAX6675" "$3"
219
+exec_test $1 $2 "MEGA2560 RAMPS | Redundant temperature sensor | 2x MAX6675 | BL Timeout" "$3"
219 220
 
220 221
 #
221 222
 # Polargraph Config

Loading…
Cancel
Save