Skip to content

Commit 407406f

Browse files
authored
Merge pull request #157 from InfiniTimeOrg/littleVgl_ClearTouchState
sim: LittleVgl: add new function ClearTouchState for PR #2108
2 parents 4fb12d1 + b86452f commit 407406f

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

sim/displayapp/LittleVgl.cpp

+9-5
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,6 @@ void MoveScreen(lv_disp_drv_t *disp_drv, int16_t height) {
220220
void LittleVgl::FlushDisplay(const lv_area_t* area, lv_color_t* color_p) {
221221
uint16_t y1, y2, width, height = 0;
222222

223-
//ulTaskNotifyTake(pdTRUE, 200);
224-
// Notification is still needed (even if there is a mutex on SPI) because of the DataCommand pin
225-
// which cannot be set/clear during a transfer.
226-
227223
//if ((scrollDirection == LittleVgl::FullRefreshDirections::Down) && (area->y2 == visibleNbLines - 1)) {
228224
// writeOffset = ((writeOffset + totalNbLines) - visibleNbLines) % totalNbLines;
229225
//} else if ((scrollDirection == FullRefreshDirections::Up) && (area->y1 == 0)) {
@@ -296,7 +292,6 @@ void LittleVgl::FlushDisplay(const lv_area_t* area, lv_color_t* color_p) {
296292
if (height > 0) {
297293
//lcd.DrawBuffer(area->x1, y1, width, height, reinterpret_cast<const uint8_t*>(color_p), width * height * 2);
298294
DrawBuffer(&disp_drv, area->x1, y1, width, height, reinterpret_cast<uint8_t*>(color_p), width * height * 2);
299-
//ulTaskNotifyTake(pdTRUE, 100);
300295
}
301296

302297
uint16_t pixOffset = width * height;
@@ -341,13 +336,22 @@ void LittleVgl::SetNewTouchPoint(int16_t x, int16_t y, bool contact) {
341336
}
342337
}
343338

339+
// Cancel an ongoing tap
340+
// Signifies that LVGL should not handle the current tap
344341
void LittleVgl::CancelTap() {
345342
if (tapped) {
346343
isCancelled = true;
347344
touchPoint = {-1, -1};
348345
}
349346
}
350347

348+
// Clear the current tapped state
349+
// Signifies that touch input processing is suspended
350+
void LittleVgl::ClearTouchState() {
351+
touchPoint = {-1, -1};
352+
tapped = false;
353+
}
354+
351355
bool LittleVgl::GetTouchPadInfo(lv_indev_data_t* ptr) {
352356
ptr->point.x = touchPoint.x;
353357
ptr->point.y = touchPoint.y;

sim/displayapp/LittleVgl.h

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ namespace Pinetime {
2626
void SetFullRefresh(FullRefreshDirections direction);
2727
void SetNewTouchPoint(int16_t x, int16_t y, bool contact);
2828
void CancelTap();
29+
void ClearTouchState();
2930

3031
bool GetFullRefresh() {
3132
bool returnValue = fullRefresh;

0 commit comments

Comments
 (0)