From f206f6f56f3e168e7a642811c3d223930b5fa5af Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 19 Apr 2024 13:10:46 +0200 Subject: [PATCH] ft6336: ignore bogus touch events At least one ft6336 device reports all 255 values from the first read after reset or poweron, even after waiting the specified 300ms reset delay. Signed-off-by: Elias Naur --- ft6336/ft6336.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ft6336/ft6336.go b/ft6336/ft6336.go index e6eb2c6..6b2032d 100644 --- a/ft6336/ft6336.go +++ b/ft6336/ft6336.go @@ -80,7 +80,8 @@ func (d *Device) Read() []byte { func (d *Device) ReadTouchPoint() touch.Point { d.Read() z := 0xFFFFF - if d.buf[0] == 0 { + switch d.buf[0] { + case 0, 255: z = 0 }