From c6bccf52252b1199a995a0896775e6159b20054f Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Fri, 24 Feb 2023 18:05:33 +0200 Subject: [PATCH 1/4] Apply InfiniTime TouchHandler changes --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 23ede70..019eb59 100644 --- a/main.cpp +++ b/main.cpp @@ -341,7 +341,7 @@ Pinetime::Controllers::NotificationManager notificationManager; Pinetime::Controllers::MotionController motionController; Pinetime::Controllers::TimerController timerController; Pinetime::Controllers::AlarmController alarmController {dateTimeController}; -Pinetime::Controllers::TouchHandler touchHandler(touchPanel, lvgl); +Pinetime::Controllers::TouchHandler touchHandler; Pinetime::Controllers::ButtonHandler buttonHandler; Pinetime::Controllers::BrightnessController brightnessController {}; From 48afc495ab04a9221e52a07eb603f5e56d729a9b Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Fri, 24 Feb 2023 18:11:26 +0200 Subject: [PATCH 2/4] Apply InfiniTime LittleVgl changes --- sim/displayapp/LittleVgl.cpp | 32 ++++++++++++++++++++++++++------ sim/displayapp/LittleVgl.h | 7 ++++--- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/sim/displayapp/LittleVgl.cpp b/sim/displayapp/LittleVgl.cpp index dca7b15..c46284e 100644 --- a/sim/displayapp/LittleVgl.cpp +++ b/sim/displayapp/LittleVgl.cpp @@ -268,15 +268,35 @@ void LittleVgl::FlushDisplay(const lv_area_t* area, lv_color_t* color_p) { vTaskDelay(pdMS_TO_TICKS(3)); } -void LittleVgl::SetNewTouchPoint(uint16_t x, uint16_t y, bool contact) { - tap_x = x; - tap_y = y; - tapped = contact; +void LittleVgl::SetNewTouchPoint(int16_t x, int16_t y, bool contact) { + if (contact) { + if (!isCancelled) { + touchPoint = {x, y}; + tapped = true; + } + } else { + if (isCancelled) { + touchPoint = {-1, -1}; + tapped = false; + isCancelled = false; + } else { + touchPoint = {x, y}; + tapped = false; + } + } } +void LittleVgl::CancelTap() { + if (tapped) { + isCancelled = true; + touchPoint = {-1, -1}; + } +} + + bool LittleVgl::GetTouchPadInfo(lv_indev_data_t* ptr) { - ptr->point.x = tap_x; - ptr->point.y = tap_y; + ptr->point.x = touchPoint.x; + ptr->point.y = touchPoint.y; if (tapped) { ptr->state = LV_INDEV_STATE_PR; } else { diff --git a/sim/displayapp/LittleVgl.h b/sim/displayapp/LittleVgl.h index 4582616..4647534 100644 --- a/sim/displayapp/LittleVgl.h +++ b/sim/displayapp/LittleVgl.h @@ -24,7 +24,8 @@ namespace Pinetime { void FlushDisplay(const lv_area_t* area, lv_color_t* color_p); bool GetTouchPadInfo(lv_indev_data_t* ptr); void SetFullRefresh(FullRefreshDirections direction); - void SetNewTouchPoint(uint16_t x, uint16_t y, bool contact); + void SetNewTouchPoint(int16_t x, int16_t y, bool contact); + void CancelTap(); bool GetFullRefresh() { bool returnValue = fullRefresh; @@ -59,9 +60,9 @@ namespace Pinetime { uint16_t writeOffset = 0; uint16_t scrollOffset = 0; - uint16_t tap_x = 0; - uint16_t tap_y = 0; + lv_point_t touchPoint = {}; bool tapped = false; + bool isCancelled = false; }; } } From 8ca2f42037369e19f143835f78e3b5949dcefef5 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Fri, 24 Feb 2023 18:19:00 +0200 Subject: [PATCH 3/4] Update InfiniTime submodule --- InfiniTime | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InfiniTime b/InfiniTime index 4b2a61e..5ab255b 160000 --- a/InfiniTime +++ b/InfiniTime @@ -1 +1 @@ -Subproject commit 4b2a61ea4ac9e3faf8fac0c871c9c998e8d2dd59 +Subproject commit 5ab255b26b4f23ca4b6fab2a660f8cf55fcda48b From df768e2030162afa33e01e44360ac620a674eb4f Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sat, 25 Feb 2023 12:34:28 +0200 Subject: [PATCH 4/4] Remove motorController from SystemTask InfiniTime change --- main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/main.cpp b/main.cpp index 019eb59..7f19459 100644 --- a/main.cpp +++ b/main.cpp @@ -376,7 +376,6 @@ Pinetime::System::SystemTask systemTask(spi, alarmController, watchdog, notificationManager, - motorController, heartRateSensor, motionController, motionSensor,