Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/displayapp/DisplayApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ void DisplayApp::RunningState() {
LoadApp(returnToApp, returnDirection);
}
lv_task_handler();
lvgl.ClearTouch();
}

void DisplayApp::StartApp(Apps app, DisplayApp::FullRefreshDirections direction) {
Expand Down
13 changes: 10 additions & 3 deletions src/displayapp/LittleVgl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,19 @@ void LittleVgl::SetNewTapEvent(uint16_t x, uint16_t y) {
tapped = true;
}

void LittleVgl::ClearTouch() {
if (touchProcessed) {
touchProcessed = false;
tapped = false;
}
}

bool LittleVgl::GetTouchPadInfo(lv_indev_data_t* ptr) {
touchProcessed = true;
ptr->point.x = tap_x;
ptr->point.y = tap_y;
if (tapped) {
ptr->point.x = tap_x;
ptr->point.y = tap_y;
ptr->state = LV_INDEV_STATE_PR;
tapped = false;
} else {
ptr->state = LV_INDEV_STATE_REL;
}
Expand Down
2 changes: 2 additions & 0 deletions src/displayapp/LittleVgl.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace Pinetime {
bool GetTouchPadInfo(lv_indev_data_t* ptr);
void SetFullRefresh(FullRefreshDirections direction);
void SetNewTapEvent(uint16_t x, uint16_t y);
void ClearTouch();

private:
void InitDisplay();
Expand Down Expand Up @@ -55,6 +56,7 @@ namespace Pinetime {
uint16_t tap_x = 0;
uint16_t tap_y = 0;
bool tapped = false;
bool touchProcessed = false;
};
}
}