mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-25 20:26:41 +00:00
Small adjustments to #213
This commit is contained in:
parent
bd0829ca67
commit
aab7f0cebf
@ -2,7 +2,6 @@
|
|||||||
// as oversampling to avoid 'bouncing'
|
// as oversampling to avoid 'bouncing'
|
||||||
// (c) ladyada / adafruit
|
// (c) ladyada / adafruit
|
||||||
// Code under MIT License
|
// Code under MIT License
|
||||||
// Code under MIT License
|
|
||||||
|
|
||||||
#ifndef _ADAFRUIT_TOUCHSCREEN_H_
|
#ifndef _ADAFRUIT_TOUCHSCREEN_H_
|
||||||
#define _ADAFRUIT_TOUCHSCREEN_H_
|
#define _ADAFRUIT_TOUCHSCREEN_H_
|
||||||
@ -81,8 +80,6 @@ TSPoint TouchScreen::getPoint(void)
|
|||||||
int samples[NUMSAMPLES];
|
int samples[NUMSAMPLES];
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
|
|
||||||
valid = 1;
|
|
||||||
|
|
||||||
pinMode(_yp, INPUT);
|
pinMode(_yp, INPUT);
|
||||||
pinMode(_ym, INPUT);
|
pinMode(_ym, INPUT);
|
||||||
pinMode(_xp, OUTPUT);
|
pinMode(_xp, OUTPUT);
|
||||||
@ -107,7 +104,6 @@ TSPoint TouchScreen::getPoint(void)
|
|||||||
digitalWrite(_yp, HIGH);
|
digitalWrite(_yp, HIGH);
|
||||||
|
|
||||||
for(i = 0; i < NUMSAMPLES; i++) {
|
for(i = 0; i < NUMSAMPLES; i++) {
|
||||||
|
|
||||||
samples[i] = analogRead(aXM);
|
samples[i] = analogRead(aXM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ static inline bool drv_touchpad_getXY(int16_t* touchX, int16_t* touchY)
|
|||||||
// touched = GT911_getXY(&normal_x, &normal_y, true);
|
// touched = GT911_getXY(&normal_x, &normal_y, true);
|
||||||
|
|
||||||
#elif TOUCH_DRIVER == 0xADC // Analog Digital Touch Conroller
|
#elif TOUCH_DRIVER == 0xADC // Analog Digital Touch Conroller
|
||||||
touched = Touch_getXY(&normal_x, &normal_y, false);
|
// touched = Touch_getXY(&normal_x, &normal_y, false);
|
||||||
|
|
||||||
#elif TOUCH_DRIVER == 5206
|
#elif TOUCH_DRIVER == 5206
|
||||||
// WARNING : this library is slooow !! use 6336 instead
|
// WARNING : this library is slooow !! use 6336 instead
|
||||||
|
@ -63,7 +63,7 @@ class BaseTouch {
|
|||||||
#elif TOUCH_DRIVER == 911
|
#elif TOUCH_DRIVER == 911
|
||||||
#warning Building for GT911
|
#warning Building for GT911
|
||||||
#include "touch_driver_gt911.h"
|
#include "touch_driver_gt911.h"
|
||||||
#elif TOUCH_DRIVER == 404
|
#elif TOUCH_DRIVER == 0xADC
|
||||||
#warning Building for analog touch
|
#warning Building for analog touch
|
||||||
#include "touch_driver_analog.h"
|
#include "touch_driver_analog.h"
|
||||||
#else
|
#else
|
||||||
@ -76,9 +76,3 @@ extern dev::BaseTouch haspTouch;
|
|||||||
|
|
||||||
// #elif TOUCH_DRIVER == 0x2046B
|
// #elif TOUCH_DRIVER == 0x2046B
|
||||||
// touched = XPT2046_getXY(&normal_x, &normal_y, true);
|
// touched = XPT2046_getXY(&normal_x, &normal_y, true);
|
||||||
|
|
||||||
// #elif TOUCH_DRIVER == 911
|
|
||||||
// touched = GT911_getXY(&normal_x, &normal_y, true);
|
|
||||||
|
|
||||||
// #elif TOUCH_DRIVER == 0xADC // Analog Digital Touch Conroller
|
|
||||||
// touched = Touch_getXY(&normal_x, &normal_y, false);
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user