1
0
Fork 0

Merge pull request #86 from Riksu9000/infinitime-changes

Fix build after InfiniTime changes
This commit is contained in:
NeroBurner 2023-02-25 18:02:52 +01:00 committed by GitHub
commit 6ccca0caf1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 12 deletions

@ -1 +1 @@
Subproject commit 4b2a61ea4ac9e3faf8fac0c871c9c998e8d2dd59 Subproject commit 5ab255b26b4f23ca4b6fab2a660f8cf55fcda48b

View file

@ -341,7 +341,7 @@ Pinetime::Controllers::NotificationManager notificationManager;
Pinetime::Controllers::MotionController motionController; Pinetime::Controllers::MotionController motionController;
Pinetime::Controllers::TimerController timerController; Pinetime::Controllers::TimerController timerController;
Pinetime::Controllers::AlarmController alarmController {dateTimeController}; Pinetime::Controllers::AlarmController alarmController {dateTimeController};
Pinetime::Controllers::TouchHandler touchHandler(touchPanel, lvgl); Pinetime::Controllers::TouchHandler touchHandler;
Pinetime::Controllers::ButtonHandler buttonHandler; Pinetime::Controllers::ButtonHandler buttonHandler;
Pinetime::Controllers::BrightnessController brightnessController {}; Pinetime::Controllers::BrightnessController brightnessController {};
@ -376,7 +376,6 @@ Pinetime::System::SystemTask systemTask(spi,
alarmController, alarmController,
watchdog, watchdog,
notificationManager, notificationManager,
motorController,
heartRateSensor, heartRateSensor,
motionController, motionController,
motionSensor, motionSensor,

View file

@ -268,15 +268,35 @@ void LittleVgl::FlushDisplay(const lv_area_t* area, lv_color_t* color_p) {
vTaskDelay(pdMS_TO_TICKS(3)); vTaskDelay(pdMS_TO_TICKS(3));
} }
void LittleVgl::SetNewTouchPoint(uint16_t x, uint16_t y, bool contact) { void LittleVgl::SetNewTouchPoint(int16_t x, int16_t y, bool contact) {
tap_x = x; if (contact) {
tap_y = y; if (!isCancelled) {
tapped = contact; 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) { bool LittleVgl::GetTouchPadInfo(lv_indev_data_t* ptr) {
ptr->point.x = tap_x; ptr->point.x = touchPoint.x;
ptr->point.y = tap_y; ptr->point.y = touchPoint.y;
if (tapped) { if (tapped) {
ptr->state = LV_INDEV_STATE_PR; ptr->state = LV_INDEV_STATE_PR;
} else { } else {

View file

@ -24,7 +24,8 @@ namespace Pinetime {
void FlushDisplay(const lv_area_t* area, lv_color_t* color_p); void FlushDisplay(const lv_area_t* area, lv_color_t* color_p);
bool GetTouchPadInfo(lv_indev_data_t* ptr); bool GetTouchPadInfo(lv_indev_data_t* ptr);
void SetFullRefresh(FullRefreshDirections direction); 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 GetFullRefresh() {
bool returnValue = fullRefresh; bool returnValue = fullRefresh;
@ -59,9 +60,9 @@ namespace Pinetime {
uint16_t writeOffset = 0; uint16_t writeOffset = 0;
uint16_t scrollOffset = 0; uint16_t scrollOffset = 0;
uint16_t tap_x = 0; lv_point_t touchPoint = {};
uint16_t tap_y = 0;
bool tapped = false; bool tapped = false;
bool isCancelled = false;
}; };
} }
} }