Skip to content

Commit

Permalink
[TouchDrv] CST816 filter invalid touch points
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Apr 29, 2024
1 parent 0047175 commit ddcc6a7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/touch/TouchClassCST816.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ uint8_t TouchClassCST816::getPoint(int16_t *x_array, int16_t *y_array, uint8_t g
// }

uint8_t point = buffer[2] & 0x0F;

// CST816 only supports single touch
if (point > 1) {
return 0;
}

#ifdef LOG_PORT
LOG_PORT.print("RAW:");
for (int i = 0; i < 13; ++i) {
Expand Down

0 comments on commit ddcc6a7

Please sign in to comment.