diff options
author | Riku Isokoski <riksu9000@gmail.com> | 2021-08-10 22:03:34 +0300 |
---|---|---|
committer | Riku Isokoski <riksu9000@gmail.com> | 2021-08-10 22:03:34 +0300 |
commit | 8a694adb0979339664da0af6d51c480d26c5527b (patch) | |
tree | 89c0deb381b34d3060edfcee249a9e5177244e67 /src/systemtask/SystemTask.cpp | |
parent | 7e92577c14895f57f5adda27ad54adbbc4b7ffe9 (diff) |
Rework TouchHandler into not a task
Diffstat (limited to 'src/systemtask/SystemTask.cpp')
-rw-r--r-- | src/systemtask/SystemTask.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 7ba7cf69..5f363130 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -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: |