Skip to content

Fix touch flickering caused by invalid buffer status! #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion TAMC_GT911.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "Arduino.h"
#include <Arduino.h>
#include <TAMC_GT911.h>
#include <Wire.h>

Expand Down Expand Up @@ -70,6 +70,10 @@ void TAMC_GT911::read(void) {
uint8_t bufferStatus = pointInfo >> 7 & 1;
uint8_t proximityValid = pointInfo >> 5 & 1;
uint8_t haveKey = pointInfo >> 4 & 1;

if (!bufferStatus)
return;

isLargeDetect = pointInfo >> 6 & 1;
touches = pointInfo & 0xF;
// Serial.print("bufferStatus: ");Serial.println(bufferStatus);
Expand Down
3 changes: 1 addition & 2 deletions TAMC_GT911.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef TAMC_GT911_H
#define TAMC_GT911_H

#include "Arduino.h"
#include <Arduino.h>
#include <Wire.h>

#define GT911_ADDR1 (uint8_t)0x5D
Expand All @@ -13,7 +13,6 @@
#define ROTATION_RIGHT (uint8_t)2
#define ROTATION_NORMAL (uint8_t)3


// Real-time command (Write only)
#define GT911_COMMAND (uint16_t)0x8040
#define GT911_ESD_CHECK (uint16_t)0x8041
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=TAMC_GT911
version=1.0.2
version=1.0.3
author=TAMC
maintainer=TAMC <tamctec@gmail.com>
sentence=Arduino library for GT911
Expand Down