Skip to content

Commit

Permalink
doxyclang
Browse files Browse the repository at this point in the history
  • Loading branch information
ladyada committed Oct 21, 2023
1 parent 162a0d1 commit 077f918
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
21 changes: 11 additions & 10 deletions Adafruit_TSC2007.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ uint16_t Adafruit_TSC2007::command(adafruit_tsc2007_function func,
// Wait 1/2ms for conversion
delayMicroseconds(500);

if (! i2c_dev->read(reply, 2)) {
if (!i2c_dev->read(reply, 2)) {
return 0;
}

Expand Down Expand Up @@ -127,28 +127,29 @@ bool Adafruit_TSC2007::read_touch(uint16_t *x, uint16_t *y, uint16_t *z1,

command(MEASURE_TEMP0, POWERDOWN_IRQON, ADC_12BIT);

if (abs((int32_t)x1-(int32_t)x2) > 100) return false;
if (abs((int32_t)y1-(int32_t)y2) > 100) return false;

if (abs((int32_t)x1 - (int32_t)x2) > 100)
return false;
if (abs((int32_t)y1 - (int32_t)y2) > 100)
return false;

*x = x1;
*y = y1;
return (*x != 4095) && (*y != 4095);
}




/*!
* @brief Function to get a point object rather than passing in pointers
* @returns A TS_Point, all values will be 0 if touchscreen read failed
*/
TS_Point Adafruit_TSC2007::getPoint(void) {
uint16_t x, y, z1, z2;

if (! this->read_touch(&x, &y, &z1, &z2)) {
if (!this->read_touch(&x, &y, &z1, &z2)) {
return TS_Point(0, 0, 0);
}
return TS_Point(x, y, z1);
}



/*!
* @brief TS_Point constructor
*/
Expand Down
1 change: 0 additions & 1 deletion Adafruit_TSC2007.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class TS_Point {
int16_t z; /**< z coordinate **/
};


/*!
* @brief Different function commands
*/
Expand Down

0 comments on commit 077f918

Please sign in to comment.