mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-25 20:26:41 +00:00
Update touch_driver_gslx680.h
This commit is contained in:
parent
ae2f0a1a6f
commit
b52768b4f6
@ -18,21 +18,22 @@
|
|||||||
#include "../../hasp/hasp.h" // for hasp_sleep_state
|
#include "../../hasp/hasp.h" // for hasp_sleep_state
|
||||||
extern uint8_t hasp_sleep_state;
|
extern uint8_t hasp_sleep_state;
|
||||||
|
|
||||||
|
GSL2038 TS = GSL2038(1, 1); // error & info
|
||||||
|
|
||||||
|
// Interrupt handling
|
||||||
|
volatile uint8_t gsl16380IRQ = 0;
|
||||||
|
|
||||||
|
// Store touch points into global variable
|
||||||
|
static void ICACHE_RAM_ATTR ontouch_irq()
|
||||||
|
{
|
||||||
|
noInterrupts();
|
||||||
|
gsl16380IRQ = 1;
|
||||||
|
interrupts();
|
||||||
|
}
|
||||||
|
|
||||||
namespace dev {
|
namespace dev {
|
||||||
|
|
||||||
class TouchGsl1680 : public BaseTouch {
|
class TouchGsl1680 : public BaseTouch {
|
||||||
private:
|
|
||||||
// Interrupt handling
|
|
||||||
volatile uint8_t gsl16380IRQ = 0;
|
|
||||||
static GSL2038 TS = GSL2038(1, 1); // error & info
|
|
||||||
|
|
||||||
// Store touch points into global variable
|
|
||||||
void ICACHE_RAM_ATTR ontouch_irq()
|
|
||||||
{
|
|
||||||
noInterrupts();
|
|
||||||
gsl16380IRQ = 1;
|
|
||||||
interrupts();
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IRAM_ATTR bool read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data)
|
IRAM_ATTR bool read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data)
|
||||||
@ -76,7 +77,7 @@ class TouchGsl1680 : public BaseTouch {
|
|||||||
touch_scan(Wire);
|
touch_scan(Wire);
|
||||||
|
|
||||||
// Startup sequence CONTROLER part
|
// Startup sequence CONTROLER part
|
||||||
TS.begin(TOUCH_SDA, TOUCH_SCL, TOUCH_RST, TOUCH_IRQ);
|
TS.begin(TOUCH_RST, TOUCH_IRQ);
|
||||||
|
|
||||||
// Setup Interrupt handler
|
// Setup Interrupt handler
|
||||||
pinMode(TOUCH_IRQ, INPUT);
|
pinMode(TOUCH_IRQ, INPUT);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user