diff --git a/src/TouchDrvGT911.hpp b/src/TouchDrvGT911.hpp index 0f7e3a0..c1aaf66 100644 --- a/src/TouchDrvGT911.hpp +++ b/src/TouchDrvGT911.hpp @@ -135,15 +135,28 @@ class TouchDrvGT911 : void sleep() { + if (__irq != SENSOR_PIN_NONE) { + this->setGpioMode(__irq, OUTPUT); + this->setGpioLevel(__irq, LOW); + } // writeRegister(GT911_COMMAND, 0x05); writeCommand(0x05); + if (__irq != SENSOR_PIN_NONE) { + this->setGpioLevel(__irq, INPUT); + } } void wakeup() { - reset(); + if (__irq != SENSOR_PIN_NONE) { + this->setGpioMode(__irq, OUTPUT); + this->setGpioLevel(__irq, HIGH); + delay(8); + } else { + reset(); + } } void idle()