From ddcc6a77487946ac1a7b2c244f8a05bee5cf2b94 Mon Sep 17 00:00:00 2001 From: lewisxhe Date: Mon, 29 Apr 2024 14:52:49 +0800 Subject: [PATCH] [TouchDrv] CST816 filter invalid touch points --- src/touch/TouchClassCST816.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/touch/TouchClassCST816.cpp b/src/touch/TouchClassCST816.cpp index 855c7b1..2d7708f 100644 --- a/src/touch/TouchClassCST816.cpp +++ b/src/touch/TouchClassCST816.cpp @@ -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) {