Rework TouchHandler into not a task

This commit is contained in:
Riku Isokoski
2021-08-10 22:03:34 +03:00
parent 7e92577c14
commit 8a694adb09
6 changed files with 50 additions and 71 deletions

View File

@@ -150,9 +150,6 @@ void SystemTask::Work() {
heartRateSensor.Disable();
heartRateApp.Start();
touchHandler.Register(this);
touchHandler.Start();
nrf_gpio_cfg_sense_input(pinButton, (nrf_gpio_pin_pull_t) GPIO_PIN_CNF_PULL_Pulldown, (nrf_gpio_pin_sense_t) GPIO_PIN_CNF_SENSE_High);
nrf_gpio_cfg_output(15);
nrf_gpio_pin_set(15);
@@ -244,6 +241,8 @@ void SystemTask::Work() {
isDimmed = false;
break;
case Messages::TouchWakeUp: {
twiMaster.Wakeup();
touchHandler.GetNewTouchInfo();
auto gesture = touchHandler.GestureGet();
if ((gesture == Pinetime::Drivers::Cst816S::Gestures::DoubleTap &&
settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::DoubleTap)) ||
@@ -299,6 +298,9 @@ void SystemTask::Work() {
xTimerStart(dimTimer, 0);
break;
case Messages::OnTouchEvent:
if (touchHandler.GetNewTouchInfo()) {
touchHandler.UpdateLvglTouchPoint();
}
ReloadIdleTimer();
break;
case Messages::OnButtonEvent: