@@ -71,6 +71,7 @@ bool Cst816S::Init() {
7171
7272Cst816S::TouchInfos Cst816S::GetTouchInfo () {
7373 Cst816S::TouchInfos info;
74+ uint8_t touchData[7 ];
7475
7576 auto ret = twiMaster.Read (twiAddress, 0 , touchData, sizeof (touchData));
7677 if (ret != TwiMaster::ErrorCodes::NoError) {
@@ -79,18 +80,16 @@ Cst816S::TouchInfos Cst816S::GetTouchInfo() {
7980 }
8081
8182 // This can only be 0 or 1
82- auto nbTouchPoints = touchData[touchPointNumIndex] & 0x0f ;
83+ uint8_t nbTouchPoints = touchData[touchPointNumIndex] & 0x0f ;
8384
84- auto xHigh = touchData[touchXHighIndex] & 0x0f ;
85- auto xLow = touchData[touchXLowIndex];
86- uint16_t x = (xHigh << 8 ) | xLow;
85+ uint8_t xHigh = touchData[touchXHighIndex] & 0x0f ;
86+ uint8_t xLow = touchData[touchXLowIndex];
87+ info. x = (xHigh << 8 ) | xLow;
8788
88- auto yHigh = touchData[touchYHighIndex] & 0x0f ;
89- auto yLow = touchData[touchYLowIndex];
90- uint16_t y = (yHigh << 8 ) | yLow;
89+ uint8_t yHigh = touchData[touchYHighIndex] & 0x0f ;
90+ uint8_t yLow = touchData[touchYLowIndex];
91+ info. y = (yHigh << 8 ) | yLow;
9192
92- info.x = x;
93- info.y = y;
9493 info.touching = (nbTouchPoints > 0 );
9594 info.gesture = static_cast <Gestures>(touchData[gestureIndex]);
9695
0 commit comments