Move old touch driver into subfolder

This commit is contained in:
fvanroie 2021-05-28 04:03:19 +02:00
parent b78378363f
commit c3ffe9cc5e
14 changed files with 39 additions and 34 deletions

View File

@ -9,23 +9,23 @@
#if TOUCH_DRIVER == 2046 #if TOUCH_DRIVER == 2046
#if defined(USE_FSMC) #if defined(USE_FSMC)
#else #else
#include "drv/touch/hasp_drv_tft_espi.h" #include "drv/old/hasp_drv_tft_espi.h"
#endif #endif
#elif TOUCH_DRIVER == 2046 #elif TOUCH_DRIVER == 2046
#include "indev/XPT2046.h" #include "indev/XPT2046.h"
#elif TOUCH_DRIVER == 0x2046B #elif TOUCH_DRIVER == 0x2046B
#include "drv/touch/hasp_drv_xpt2046.h" #include "drv/old/hasp_drv_xpt2046.h"
#elif TOUCH_DRIVER == 911 #elif TOUCH_DRIVER == 911
#include "drv/touch/hasp_drv_gt911.h" #include "drv/old/hasp_drv_gt911.h"
#elif TOUCH_DRIVER == 0xADC #elif TOUCH_DRIVER == 0xADC
#include "drv/touch/hasp_drv_ft6336u.h" #include "drv/old/hasp_drv_ft6336u.h"
#elif TOUCH_DRIVER == 5206 #elif TOUCH_DRIVER == 5206
#include "drv/touch/hasp_drv_ft5206.h" #include "drv/old/hasp_drv_ft5206.h"
#elif TOUCH_DRIVER == 6336 #elif TOUCH_DRIVER == 6336
#include "drv/touch/hasp_drv_ft6336u.h" #include "drv/old/hasp_drv_ft6336u.h"
#elif TOUCH_DRIVER == 610 #elif TOUCH_DRIVER == 610
#include "drv/touch/hasp_drv_stmpe610.h" #include "drv/old/hasp_drv_stmpe610.h"
#else #else
//#include "tp_i2c.h" //#include "tp_i2c.h"
//#include "ft6x36.h" //#include "ft6x36.h"
@ -188,11 +188,7 @@ IRAM_ATTR bool drv_touch_read(lv_indev_drv_t* indev_driver, lv_indev_data_t* dat
touched = drv_touchpad_getXY(&touchX, &touchY); touched = drv_touchpad_getXY(&touchX, &touchY);
} }
if(!touched) { if(touched) {
data->state = LV_INDEV_STATE_REL;
return false;
}
if(hasp_sleep_state /* != HASP_SLEEP_OFF */) hasp_update_sleep_state(); // update Idle if(hasp_sleep_state /* != HASP_SLEEP_OFF */) hasp_update_sleep_state(); // update Idle
if(touch_invert_x) { if(touch_invert_x) {
@ -206,10 +202,17 @@ IRAM_ATTR bool drv_touch_read(lv_indev_drv_t* indev_driver, lv_indev_data_t* dat
} else { } else {
data->point.y = touchY; data->point.y = touchY;
} }
#endif
/*Save the state and save the pressed coordinate for cursor position */ /*Save the state and save the pressed coordinate for cursor position */
data->state = LV_INDEV_STATE_PR; data->state = LV_INDEV_STATE_PR;
} else {
data->state = LV_INDEV_STATE_REL;
} // touched
#else
data->state = LV_INDEV_STATE_REL;
#endif
/*Return `false` because we are not buffering and no more data to read*/ /*Return `false` because we are not buffering and no more data to read*/
return false; return false;

View File

@ -1,4 +1,4 @@
#if TOUCH_DRIVER == 6336 #if 0 // TOUCH_DRIVER == 6336
#include <Wire.h> #include <Wire.h>
#include "FT6336U.h" #include "FT6336U.h"
@ -13,14 +13,16 @@ FT6336U* touchpanel;
// Read touch points // Read touch points
HASP_ATTRIBUTE_FAST_MEM bool FT6336U_getXY(int16_t* touchX, int16_t* touchY, bool debug) HASP_ATTRIBUTE_FAST_MEM bool FT6336U_getXY(int16_t* touchX, int16_t* touchY, bool debug)
{ {
if(touchpanel->read_touch_number() != 1) return false; if(touchpanel->read_touch_number() == 1) {
*touchX = touchpanel->read_touch1_x(); *touchX = touchpanel->read_touch1_x();
*touchY = touchpanel->read_touch1_y(); *touchY = touchpanel->read_touch1_y();
return true; return true;
} else {
return false;
}
} }
void scan(TwoWire& i2c) static void scan(TwoWire& i2c)
{ {
byte error, address; byte error, address;
int nDevices; int nDevices;

View File

@ -15,7 +15,7 @@
//#include "drv/hasp_drv_display.h" //#include "drv/hasp_drv_display.h"
#include "drv/hasp_drv_touch.h" #include "drv/hasp_drv_touch.h"
#include "drv/touch/hasp_drv_tft_espi.h" #include "drv/old/hasp_drv_tft_espi.h"
#include "hasp_debug.h" #include "hasp_debug.h"
#include "hasp_config.h" #include "hasp_config.h"