Implemented timeout reset on input event

This commit is contained in:
Mike C 2013-04-17 20:06:53 -04:00
parent ebd4ac5d04
commit 7f60a42f9b
2 changed files with 9 additions and 0 deletions

View file

@ -33,6 +33,10 @@ void UI::setLCDTimeout() {
uiTimeout->interval(config->getTimeoutMilis()); uiTimeout->interval(config->getTimeoutMilis());
} }
void UI::resetTimeout() {
uiTimeout->reset();
}
void UI::startUI() { void UI::startUI() {
if (DEBUG) { if (DEBUG) {
Serial.println("Config::startUI()"); Serial.println("Config::startUI()");
@ -75,10 +79,12 @@ void UI::processInputEvents() {
enableUI(); enableUI();
return; return;
} }
if (DEBUG) { if (DEBUG) {
Serial.print("Joystick Event: "); Serial.print("Joystick Event: ");
Serial.println(joyStickEvent); Serial.println(joyStickEvent);
} }
resetTimeout();
lcd->handleJoystickEvent(joyStickEvent); lcd->handleJoystickEvent(joyStickEvent);
} }
@ -87,6 +93,7 @@ void UI::processInputEvents() {
enableUI(); enableUI();
return; return;
} }
resetTimeout();
lcd->handleOkButtonEvent(); lcd->handleOkButtonEvent();
} }
@ -95,6 +102,7 @@ void UI::processInputEvents() {
enableUI(); enableUI();
return; return;
} }
resetTimeout();
lcd->handleCancelButtonEvent(); lcd->handleCancelButtonEvent();
} }
} }

View file

@ -49,6 +49,7 @@ public:
void enableUI(); void enableUI();
void setLCDTimeout(); void setLCDTimeout();
void resetTimeout();
}; };
#endif #endif