LCD Backlight Timer (#23768)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
M. FURIC Franck
2022-02-26 23:54:04 +01:00
committed by Scott Lahteine
parent 3db2fecaa4
commit 39001bd8d2
9 changed files with 82 additions and 3 deletions

View File

@ -391,6 +391,13 @@ typedef struct SettingsDataStruct {
//
uint8_t lcd_brightness; // M256 B
//
// LCD_BACKLIGHT_TIMEOUT
//
#if LCD_BACKLIGHT_TIMEOUT
uint16_t lcd_backlight_timeout; // (G-code needed)
#endif
//
// Controller fan settings
//
@ -607,6 +614,10 @@ void MarlinSettings::postprocess() {
// Moved as last update due to interference with Neopixel init
TERN_(HAS_LCD_CONTRAST, ui.refresh_contrast());
TERN_(HAS_LCD_BRIGHTNESS, ui.refresh_brightness());
#if LCD_BACKLIGHT_TIMEOUT
ui.refresh_backlight_timeout();
#endif
}
#if BOTH(PRINTCOUNTER, EEPROM_SETTINGS)
@ -1108,6 +1119,13 @@ void MarlinSettings::postprocess() {
EEPROM_WRITE(lcd_brightness);
}
//
// LCD Backlight Timeout
//
#if LCD_BACKLIGHT_TIMEOUT
EEPROM_WRITE(ui.lcd_backlight_timeout);
#endif
//
// Controller Fan
//
@ -2015,6 +2033,13 @@ void MarlinSettings::postprocess() {
TERN_(HAS_LCD_BRIGHTNESS, if (!validating) ui.brightness = lcd_brightness);
}
//
// LCD Backlight Timeout
//
#if LCD_BACKLIGHT_TIMEOUT
EEPROM_READ(ui.lcd_backlight_timeout);
#endif
//
// Controller Fan
//
@ -3040,6 +3065,13 @@ void MarlinSettings::reset() {
//
TERN_(HAS_LCD_BRIGHTNESS, ui.brightness = LCD_BRIGHTNESS_DEFAULT);
//
// LCD Backlight Timeout
//
#if LCD_BACKLIGHT_TIMEOUT
ui.lcd_backlight_timeout = LCD_BACKLIGHT_TIMEOUT;
#endif
//
// Controller Fan
//