mirror of
https://github.com/esphome/esphome.git
synced 2024-11-15 11:38:11 +01:00
release after touch
This commit is contained in:
parent
ee46b96f56
commit
939c182613
1 changed files with 4 additions and 0 deletions
|
@ -44,6 +44,8 @@ void ICNT86Touchscreen::setup() {
|
|||
|
||||
void ICNT86Touchscreen::loop() {
|
||||
if (!this->store_.touch) {
|
||||
for (auto *listener : this->touch_listeners_)
|
||||
listener->release();
|
||||
return;
|
||||
}
|
||||
ESP_LOGD(TAG, "touch");
|
||||
|
@ -62,6 +64,8 @@ void ICNT86Touchscreen::loop() {
|
|||
if (buf[0] == 0x00) { // No new touch
|
||||
this->ICNT_Write_(0x1001, mask, 1);
|
||||
delay(1);
|
||||
for (auto *listener : this->touch_listeners_)
|
||||
listener->release();
|
||||
return;
|
||||
} else {
|
||||
if (touch_count > 5 || touch_count < 1) {
|
||||
|
|
Loading…
Reference in a new issue