From 7f60a42f9b14fa9d5da2be9be09cf577cff97056 Mon Sep 17 00:00:00 2001 From: Mike C Date: Wed, 17 Apr 2013 20:06:53 -0400 Subject: [PATCH] Implemented timeout reset on input event --- Universal_Serial_Adapter/UI.cpp | 8 ++++++++ Universal_Serial_Adapter/UI.h | 1 + 2 files changed, 9 insertions(+) diff --git a/Universal_Serial_Adapter/UI.cpp b/Universal_Serial_Adapter/UI.cpp index 8198a04..afaa651 100644 --- a/Universal_Serial_Adapter/UI.cpp +++ b/Universal_Serial_Adapter/UI.cpp @@ -33,6 +33,10 @@ void UI::setLCDTimeout() { uiTimeout->interval(config->getTimeoutMilis()); } +void UI::resetTimeout() { + uiTimeout->reset(); +} + void UI::startUI() { if (DEBUG) { Serial.println("Config::startUI()"); @@ -75,10 +79,12 @@ void UI::processInputEvents() { enableUI(); return; } + if (DEBUG) { Serial.print("Joystick Event: "); Serial.println(joyStickEvent); } + resetTimeout(); lcd->handleJoystickEvent(joyStickEvent); } @@ -87,6 +93,7 @@ void UI::processInputEvents() { enableUI(); return; } + resetTimeout(); lcd->handleOkButtonEvent(); } @@ -95,6 +102,7 @@ void UI::processInputEvents() { enableUI(); return; } + resetTimeout(); lcd->handleCancelButtonEvent(); } } diff --git a/Universal_Serial_Adapter/UI.h b/Universal_Serial_Adapter/UI.h index 38fe0a0..32c87ae 100644 --- a/Universal_Serial_Adapter/UI.h +++ b/Universal_Serial_Adapter/UI.h @@ -49,6 +49,7 @@ public: void enableUI(); void setLCDTimeout(); + void resetTimeout(); }; #endif