Skip to content

Commit c96ed89

Browse files
sjasonsmiththinkyhead
authored andcommitted
🩹 Fix LCD_BACKLIGHT_TIMEOUT compile (#24463)
1 parent b025c18 commit c96ed89

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

Marlin/src/gcode/gcode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ class GcodeSuite {
885885
static void M250_report(const bool forReplay=true);
886886
#endif
887887

888-
#if HAS_DISPLAY_SLEEP
888+
#if HAS_GCODE_M255
889889
static void M255();
890890
static void M255_report(const bool forReplay=true);
891891
#endif

Marlin/src/gcode/lcd/M255.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void GcodeSuite::M255() {
3636
const int m = parser.value_int();
3737
ui.sleep_timeout_minutes = constrain(m, SLEEP_TIMEOUT_MIN, SLEEP_TIMEOUT_MAX);
3838
#else
39-
const int s = parser.value_int() * 60;
39+
const unsigned int s = parser.value_ushort() * 60;
4040
ui.lcd_backlight_timeout = constrain(s, LCD_BKL_TIMEOUT_MIN, LCD_BKL_TIMEOUT_MAX);
4141
#endif
4242
}

Marlin/src/inc/Conditionals_adv.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,10 @@
587587
#define HAS_PRINT_PROGRESS 1
588588
#endif
589589

590+
#if ANY(HAS_MARLINUI_MENU, ULTIPANEL_FEEDMULTIPLY, SOFT_RESET_ON_KILL)
591+
#define HAS_ENCODER_ACTION 1
592+
#endif
593+
590594
#if STATUS_MESSAGE_TIMEOUT_SEC > 0
591595
#define HAS_STATUS_MESSAGE_TIMEOUT 1
592596
#endif

Marlin/src/lcd/marlinui.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232
#include "tft_io/touch_calibration.h"
3333
#endif
3434

35-
#if ANY(HAS_MARLINUI_MENU, ULTIPANEL_FEEDMULTIPLY, SOFT_RESET_ON_KILL)
36-
#define HAS_ENCODER_ACTION 1
37-
#endif
38-
3935
#if E_MANUAL > 1
4036
#define MULTI_E_MANUAL 1
4137
#endif
@@ -273,8 +269,8 @@ class MarlinUI {
273269
#endif
274270

275271
#if LCD_BACKLIGHT_TIMEOUT
276-
#define LCD_BKL_TIMEOUT_MIN 1
277-
#define LCD_BKL_TIMEOUT_MAX (60*60*18) // 18 hours max within uint16_t
272+
#define LCD_BKL_TIMEOUT_MIN 1u
273+
#define LCD_BKL_TIMEOUT_MAX UINT16_MAX // Slightly more than 18 hours
278274
static uint16_t lcd_backlight_timeout;
279275
static millis_t backlight_off_ms;
280276
static void refresh_backlight_timeout();

buildroot/tests/mega2560

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,17 @@ opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOO
206206
exec_test $1 $2 "MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Laser Safety Timeout | Flowmeter | 44780 LCD " "$3"
207207

208208
#
209-
# Test redundant temperature sensors + MAX TC
209+
# Test redundant temperature sensors + MAX TC + Backlight Timeout
210210
#
211211
restore_configs
212212
opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 1 \
213213
TEMP_SENSOR_0 -2 TEMP_SENSOR_REDUNDANT -2 \
214214
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
217218
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"
219220

220221
#
221222
# Polargraph Config

0 commit comments

Comments
 (0)