From 885b23b8320554af2feee1b26696b2ab59f7d8c7 Mon Sep 17 00:00:00 2001 From: Vasily Davydov Date: Fri, 14 Oct 2022 12:44:14 +0300 Subject: [PATCH] state-handler: add buttonHandler --- StateHandler/inc/StateHandler.h | 6 ++++++ StateHandler/src/StateHandler.cpp | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/StateHandler/inc/StateHandler.h b/StateHandler/inc/StateHandler.h index 7a847a3..1c73f9d 100644 --- a/StateHandler/inc/StateHandler.h +++ b/StateHandler/inc/StateHandler.h @@ -124,6 +124,12 @@ private: * @param event */ void stateAuto (const Event &event); + + /** Hnadle button presses + * + * @param button current button + */ + void handleControlButtons (uint8_t button); }; #endif /* STATE_HANDLER_H_ */ diff --git a/StateHandler/src/StateHandler.cpp b/StateHandler/src/StateHandler.cpp index c464a8f..d2202d8 100644 --- a/StateHandler/src/StateHandler.cpp +++ b/StateHandler/src/StateHandler.cpp @@ -130,4 +130,23 @@ stateAuto (const Event &event) case Event::eTick: break; } +} + +void +handleControlButtons (uint8_t button) +{ + switch (button) + { + case BUTTON_CONTROL_DOWN: + /* code */ + break; + case BUTTON_CONTROL_UP: + /* code */ + break; + case BUTTON_CONTROL_TOG_MODE: + /* code */ + break; + default: + break; + } } \ No newline at end of file