1
0
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:
Rhys Weatherley 2012-05-20 13:32:00 +10:00
parent 1a1d3079c0
commit 26ec45a659

View File

@ -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;