Apply InfiniTime LittleVgl changes
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user