Commit 9aa8c62c authored by Rahix's avatar Rahix
Browse files

feat(display): Don't send superfluous sleep commands

"Cache" the local sleep value to not send repetitive sleep-out commands
to the display when the user repeatedly sets the backlight.
parent ade3dd2f
Pipeline #5275 passed with stages
in 47 seconds
......@@ -161,6 +161,13 @@ static void lcd_hard_reset(void)
void lcd_set_sleep(bool sleep)
static int current_sleep = -1;
if (sleep == current_sleep) {
current_sleep = sleep;
if (sleep) {
lcd_send_command(LCD_SLPIN, NULL, 0);
} else {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment