diff --git a/TouchScreen.cpp b/TouchScreen.cpp index 8fc016e..1b6d9d4 100644 --- a/TouchScreen.cpp +++ b/TouchScreen.cpp @@ -179,7 +179,7 @@ TSPoint TouchScreen::getPoint(void) { rtouch -= 1; rtouch *= x; rtouch *= _rxplate; - rtouch /= _adcMax+1; + rtouch /= _adcMax + 1; z = rtouch; } else { @@ -283,7 +283,7 @@ uint16_t TouchScreen::pressure(void) { rtouch -= 1; rtouch *= readTouchX(); rtouch *= _rxplate; - rtouch /= _adcMax+1; + rtouch /= _adcMax + 1; return rtouch; } else { diff --git a/TouchScreen.h b/TouchScreen.h index 81839a8..b594485 100644 --- a/TouchScreen.h +++ b/TouchScreen.h @@ -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 @@ -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;