mirror of
https://github.com/taigrr/arduinolibs
synced 2025-01-18 04:33:12 -08:00
Bug fix for BacklightOnSelect
This commit is contained in:
parent
1a1d3079c0
commit
26ec45a659
@ -321,11 +321,22 @@ int FreetronicsLCD::getButton()
|
||||
prevButton = button;
|
||||
if (screenSaved) {
|
||||
// Button pressed when screen saver active.
|
||||
display();
|
||||
if (mode == DisplayOff) {
|
||||
if (mode == BacklightOnSelect) {
|
||||
// Turn on the back light only if Select was pressed.
|
||||
if (button == LCD_BUTTON_SELECT) {
|
||||
digitalWrite(LCD_BACK_LIGHT, HIGH);
|
||||
screenSaved = false;
|
||||
}
|
||||
} else if (mode == DisplayOff) {
|
||||
display();
|
||||
eatRelease = true;
|
||||
return LCD_BUTTON_NONE;
|
||||
} else {
|
||||
display();
|
||||
}
|
||||
} else if (mode == BacklightOnSelect && button != LCD_BUTTON_SELECT) {
|
||||
eatRelease = false;
|
||||
return button;
|
||||
}
|
||||
eatRelease = false;
|
||||
lastRestore = currentTime;
|
||||
|
Loading…
x
Reference in New Issue
Block a user