Skip to content

Commit f9fbd8a

Browse files
danieldegrassecarlescufi
authored andcommitted
drivers: kscan: gt911: ignore touch events if TOUCH_STATUS mask is clear
Ignore touch events from GT911 IC when TOUCH_STATUS_MSK bit is not set in status register. This resolves an error where the GT911 driver would report a touch event end directly after a touch occured, as the touch status register would be 0x0, which the driver incorrectly interpreted as a touch release. Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
1 parent 7ef5445 commit f9fbd8a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/kscan/kscan_gt911.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ static int gt911_process(const struct device *dev)
9696
return 0;
9797
}
9898

99+
if (!(status & TOUCH_STATUS_MSK)) {
100+
/* Status bit not set, ignore this event */
101+
return 0;
102+
}
99103
/* need to clear the status */
100104
uint8_t clear_buffer[3] = {(uint8_t)REG_STATUS, (uint8_t)(REG_STATUS >> 8), 0};
101105

0 commit comments

Comments
 (0)