Skip to content

Commit

Permalink
Reformatted to satisfy PR clang check
Browse files Browse the repository at this point in the history
  • Loading branch information
ScruffR committed Oct 15, 2023
1 parent 22d6563 commit c5b9e0c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions TouchScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ TSPoint TouchScreen::getPoint(void) {
rtouch -= 1;
rtouch *= x;
rtouch *= _rxplate;
rtouch /= _adcMax+1;
rtouch /= _adcMax + 1;

z = rtouch;
} else {
Expand Down Expand Up @@ -283,7 +283,7 @@ uint16_t TouchScreen::pressure(void) {
rtouch -= 1;
rtouch *= readTouchX();
rtouch *= _rxplate;
rtouch /= _adcMax+1;
rtouch /= _adcMax + 1;

return rtouch;
} else {
Expand Down
14 changes: 8 additions & 6 deletions TouchScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ class TouchScreen {
* @param yp Y+ pin. Must be an analog pin
* @param xm X- pin. Can be a digital pin
* @param ym Y- pin. Can be a digital pin
* @param rx The resistance in ohms between X+ and X- to calibrate pressure sensing
* @param adcBits for µC with higher resolution ADCs provide the number of bits
* @param rx The resistance in ohms between X+ and X- to calibrate pressure
* sensing
* @param adcBits for µC with higher resolution ADCs provide the number of
* bits
*/
TouchScreen(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym, uint16_t rx = 0
, uint8_t adcBits = 10);
TouchScreen(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym, uint16_t rx = 0,
uint8_t adcBits = 10);

/**
* @brief **NOT IMPLEMENTED** Test if the screen has been touched
Expand All @@ -69,9 +71,9 @@ class TouchScreen {
int16_t pressureThreshhold; ///< Pressure threshold for `isTouching`

private:
uint8_t _yp, _ym, _xm, _xp;
uint8_t _yp, _ym, _xm, _xp;
uint16_t _rxplate;
uint16_t _adcMax; // maximum reading of ADC (= 2^adcBits - 1)
uint16_t _adcMax; // maximum reading of ADC (= 2^adcBits - 1)
#if defined(USE_FAST_PINIO)
volatile RwReg *xp_port, *yp_port, *xm_port, *ym_port;
RwReg xp_pin, xm_pin, yp_pin, ym_pin;
Expand Down

0 comments on commit c5b9e0c

Please sign in to comment.