release after touch

This commit is contained in:
SGE 2023-12-12 16:59:32 +01:00
parent ee46b96f56
commit 939c182613

View file

@ -44,6 +44,8 @@ void ICNT86Touchscreen::setup() {
void ICNT86Touchscreen::loop() { void ICNT86Touchscreen::loop() {
if (!this->store_.touch) { if (!this->store_.touch) {
for (auto *listener : this->touch_listeners_)
listener->release();
return; return;
} }
ESP_LOGD(TAG, "touch"); ESP_LOGD(TAG, "touch");
@ -62,6 +64,8 @@ void ICNT86Touchscreen::loop() {
if (buf[0] == 0x00) { // No new touch if (buf[0] == 0x00) { // No new touch
this->ICNT_Write_(0x1001, mask, 1); this->ICNT_Write_(0x1001, mask, 1);
delay(1); delay(1);
for (auto *listener : this->touch_listeners_)
listener->release();
return; return;
} else { } else {
if (touch_count > 5 || touch_count < 1) { if (touch_count > 5 || touch_count < 1) {