Skip to content
Snippets Groups Projects
Commit ab09b036 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 2696bf82
No related branches found
No related tags found
No related merge requests found
Pipeline #5257 passed
......@@ -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) {
return;
}
current_sleep = sleep;
if (sleep) {
lcd_send_command(LCD_SLPIN, NULL, 0);
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment