♻️ Display sleep minutes, encoder disable option (#24618)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
committed by
Scott Lahteine
parent
f088722ae8
commit
ef1cf0d5a1
@ -32,12 +32,11 @@
|
||||
*/
|
||||
void GcodeSuite::M255() {
|
||||
if (parser.seenval('S')) {
|
||||
const int m = parser.value_int();
|
||||
#if HAS_DISPLAY_SLEEP
|
||||
const int m = parser.value_int();
|
||||
ui.sleep_timeout_minutes = constrain(m, SLEEP_TIMEOUT_MIN, SLEEP_TIMEOUT_MAX);
|
||||
ui.sleep_timeout_minutes = constrain(m, ui.sleep_timeout_min, ui.sleep_timeout_max);
|
||||
#else
|
||||
const unsigned int s = parser.value_ushort() * 60;
|
||||
ui.lcd_backlight_timeout = constrain(s, LCD_BKL_TIMEOUT_MIN, LCD_BKL_TIMEOUT_MAX);
|
||||
ui.backlight_timeout_minutes = constrain(m, ui.backlight_timeout_min, ui.backlight_timeout_max);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@ -47,11 +46,8 @@ void GcodeSuite::M255() {
|
||||
void GcodeSuite::M255_report(const bool forReplay/*=true*/) {
|
||||
report_heading_etc(forReplay, F(STR_DISPLAY_SLEEP));
|
||||
SERIAL_ECHOLNPGM(" M255 S",
|
||||
#if HAS_DISPLAY_SLEEP
|
||||
ui.sleep_timeout_minutes, " ; (minutes)"
|
||||
#else
|
||||
ui.lcd_backlight_timeout, " ; (seconds)"
|
||||
#endif
|
||||
TERN(HAS_DISPLAY_SLEEP, ui.sleep_timeout_minutes, ui.backlight_timeout_minutes),
|
||||
" ; (minutes)"
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user