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`.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "BootloaderVersion.h"
|
||||
#include "components/battery/BatteryController.h"
|
||||
#include "components/ble/BleController.h"
|
||||
#include "displayapp/TouchEvents.h"
|
||||
#include "drivers/Cst816s.h"
|
||||
#include "drivers/St7789.h"
|
||||
#include "drivers/InternalFlash.h"
|
||||
@@ -265,10 +266,10 @@ void SystemTask::Work() {
|
||||
case Messages::TouchWakeUp: {
|
||||
if (touchHandler.GetNewTouchInfo()) {
|
||||
auto gesture = touchHandler.GestureGet();
|
||||
if (gesture != Pinetime::Drivers::Cst816S::Gestures::None and
|
||||
((gesture == Pinetime::Drivers::Cst816S::Gestures::DoubleTap and
|
||||
if (gesture != Pinetime::Applications::TouchEvents::None and
|
||||
((gesture == Pinetime::Applications::TouchEvents::DoubleTap and
|
||||
settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::DoubleTap)) or
|
||||
(gesture == Pinetime::Drivers::Cst816S::Gestures::SingleTap and
|
||||
(gesture == Pinetime::Applications::TouchEvents::Tap and
|
||||
settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::SingleTap)))) {
|
||||
GoToRunning();
|
||||
}
|
||||
|
Reference in New Issue
Block a user