summaryrefslogtreecommitdiff
path: root/src/displayapp
diff options
context:
space:
mode:
authorReinhold Gschweicher <pyro4hell@gmail.com>2022-01-16 23:37:15 +0100
committerJF <JF002@users.noreply.github.com>2022-04-13 21:33:58 +0200
commit2607c3d79947e900ce4c5ded296f649677511a34 (patch)
treecb22b11d9df9296921f8ec33be2393f664e471f5 /src/displayapp
parentb498e1d633522eed975d78b04508834b7a79befe (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')
-rw-r--r--src/displayapp/DisplayApp.cpp24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp
index 9ce29da6..32280615 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;
}