Fysetc LCD backlight timeout (#14265)

This commit is contained in:
MastS
2019-06-13 04:59:39 +02:00
committed by Scott Lahteine
parent 8bc3b80176
commit 18904c42f6
6 changed files with 74 additions and 9 deletions

View File

@ -201,6 +201,17 @@ public:
static void toggle(); // swap "off" with color
static inline void update() { set_color(color); }
#endif
#ifdef LED_BACKLIGHT_TIMEOUT
private:
static millis_t led_off_time;
public:
static inline void reset_timeout(const millis_t &ms) {
led_off_time = ms + LED_BACKLIGHT_TIMEOUT;
if (!lights_on) set_default();
}
static void update_timeout(const bool power_on);
#endif
};
extern LEDLights leds;