Skip to content

Commit

Permalink
TouchDrv fix GT911 sleep and wakeup
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Mar 18, 2024
1 parent 596697b commit 3c51983
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/TouchDrvGT911.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3c51983

Please sign in to comment.