diff options
| author | Reinhold Gschweicher <pyro4hell@gmail.com> | 2022-01-16 22:37:15 (GMT) |
|---|---|---|
| committer | JF <JF002@users.noreply.github.com> | 2022-04-13 19:33:58 (GMT) |
| commit | 2607c3d79947e900ce4c5ded296f649677511a34 (patch) | |
| tree | cb22b11d9df9296921f8ec33be2393f664e471f5 /src/displayapp/DisplayApp.cpp | |
| parent | b498e1d633522eed975d78b04508834b7a79befe (diff) | |
Let TouchHandler return TouchEvents instead of driver specific enum
Let the TouchHandler::GestureGet() function return a TouchEvent instead
of the touchpanel-driver specific enum.
This helps to move the driver specific helper function `ConvertGesture`
from `DisplayApp` into `TouchHandler`.
Diffstat (limited to 'src/displayapp/DisplayApp.cpp')
| -rw-r--r-- | src/displayapp/DisplayApp.cpp | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 9ce29da..3228061 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -60,28 +60,6 @@ namespace { static inline bool in_isr(void) { return (SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk) != 0; } - - TouchEvents ConvertGesture(Pinetime::Drivers::Cst816S::Gestures gesture) { - switch (gesture) { - case Pinetime::Drivers::Cst816S::Gestures::SingleTap: - return TouchEvents::Tap; - case Pinetime::Drivers::Cst816S::Gestures::LongPress: - return TouchEvents::LongTap; - case Pinetime::Drivers::Cst816S::Gestures::DoubleTap: - return TouchEvents::DoubleTap; - case Pinetime::Drivers::Cst816S::Gestures::SlideRight: - return TouchEvents::SwipeRight; - case Pinetime::Drivers::Cst816S::Gestures::SlideLeft: - return TouchEvents::SwipeLeft; - case Pinetime::Drivers::Cst816S::Gestures::SlideDown: - return TouchEvents::SwipeDown; - case Pinetime::Drivers::Cst816S::Gestures::SlideUp: - return TouchEvents::SwipeUp; - case Pinetime::Drivers::Cst816S::Gestures::None: - default: - return TouchEvents::None; - } - } } DisplayApp::DisplayApp(Drivers::St7789& lcd, @@ -227,7 +205,7 @@ void DisplayApp::Refresh() { if (state != States::Running) { break; } - auto gesture = ConvertGesture(touchHandler.GestureGet()); + auto gesture = touchHandler.GestureGet(); if (gesture == TouchEvents::None) { break; } |
