aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/Cst816s.h
diff options
context:
space:
mode:
authorJF <JF002@users.noreply.github.com>2021-11-08 21:59:25 +0100
committerGitHub <noreply@github.com>2021-11-08 21:59:25 +0100
commit755ab72495b16bbe4cc64c33833c7cc30b815ca0 (patch)
tree30553e3e135afa900901881b1fafec19a83d6b12 /src/drivers/Cst816s.h
parent76c43ebc82eb1d6580a10f292c83b0b18da135e6 (diff)
parent8d61419836bffa7c59cb41c33fe747bafe841af5 (diff)
Merge pull request #811 from InfiniTimeOrg/cst816-add-validity-check
Add data validity check and retries in CST816S driver
Diffstat (limited to 'src/drivers/Cst816s.h')
-rw-r--r--src/drivers/Cst816s.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/drivers/Cst816s.h b/src/drivers/Cst816s.h
index 0fec8419..507dd4f5 100644
--- a/src/drivers/Cst816s.h
+++ b/src/drivers/Cst816s.h
@@ -21,7 +21,7 @@ namespace Pinetime {
uint16_t y = 0;
Gestures gesture = Gestures::None;
bool touching = false;
- bool isValid = true;
+ bool isValid = false;
};
Cst816S(TwiMaster& twiMaster, uint8_t twiAddress);
@@ -45,6 +45,8 @@ namespace Pinetime {
return fwVersion;
}
private:
+ bool CheckDeviceIds();
+
// Unused/Unavailable commented out
static constexpr uint8_t gestureIndex = 1;
static constexpr uint8_t touchPointNumIndex = 2;
@@ -58,6 +60,9 @@ namespace Pinetime {
//static constexpr uint8_t touchXYIndex = 7;
//static constexpr uint8_t touchMiscIndex = 8;
+ static constexpr uint8_t maxX = 240;
+ static constexpr uint8_t maxY = 240;
+
TwiMaster& twiMaster;
uint8_t twiAddress;