Browse Source

🩹 Fix LCD_BACKLIGHT_TIMEOUT compile (#24463)

Jason Smith 2 years ago
parent
commit
f65f7a685b
No account linked to committer's email address

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

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

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

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

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

591
   #define HAS_PRINT_PROGRESS 1
591
   #define HAS_PRINT_PROGRESS 1
592
 #endif
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
 #if STATUS_MESSAGE_TIMEOUT_SEC > 0
598
 #if STATUS_MESSAGE_TIMEOUT_SEC > 0
595
   #define HAS_STATUS_MESSAGE_TIMEOUT 1
599
   #define HAS_STATUS_MESSAGE_TIMEOUT 1
596
 #endif
600
 #endif

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

32
   #include "tft_io/touch_calibration.h"
32
   #include "tft_io/touch_calibration.h"
33
 #endif
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
 #if E_MANUAL > 1
35
 #if E_MANUAL > 1
40
   #define MULTI_E_MANUAL 1
36
   #define MULTI_E_MANUAL 1
41
 #endif
37
 #endif
271
   #endif
267
   #endif
272
 
268
 
273
   #if LCD_BACKLIGHT_TIMEOUT
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
     static uint16_t lcd_backlight_timeout;
272
     static uint16_t lcd_backlight_timeout;
277
     static millis_t backlight_off_ms;
273
     static millis_t backlight_off_ms;
278
     static void refresh_backlight_timeout();
274
     static void refresh_backlight_timeout();

+ 5
- 4
buildroot/tests/mega2560 View File

206
 exec_test $1 $2 "MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Laser Safety Timeout | Flowmeter | 44780 LCD " "$3"
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
 restore_configs
211
 restore_configs
212
 opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 1 \
212
 opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 1 \
213
         TEMP_SENSOR_0 -2 TEMP_SENSOR_REDUNDANT -2 \
213
         TEMP_SENSOR_0 -2 TEMP_SENSOR_REDUNDANT -2 \
214
         TEMP_SENSOR_REDUNDANT_SOURCE E1 TEMP_SENSOR_REDUNDANT_TARGET E0 \
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
 opt_disable PIDTEMP
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
 # Polargraph Config
222
 # Polargraph Config

Loading…
Cancel
Save