Improves time for setting touch interrupt (#7099)

* Improves time for setting touch interrupt

* Fixes Interrupt Touchpad initialization

Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
This commit is contained in:
Rodrigo Garcia 2022-08-11 05:18:36 -03:00 committed by GitHub
parent 3e65a5721a
commit 0130856b2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -212,19 +212,13 @@ static void __touchConfigInterrupt(uint8_t pin, void (*userFunc)(void), void *Ar
} else {
// attach ISR User Call
__touchInit();
#if SOC_TOUCH_VERSION_2 // ESP32S2, ESP32S3
__touchChannelInit(pad);
#endif
__touchInterruptHandlers[pad].fn = userFunc;
__touchInterruptHandlers[pad].callWithArgs = callWithArgs;
__touchInterruptHandlers[pad].arg = Args;
}
#if SOC_TOUCH_VERSION_1 // ESP32
touch_pad_config(pad, threshold);
#elif SOC_TOUCH_VERSION_2 // ESP32S2, ESP32S3
touch_pad_set_thresh(pad, threshold);
#endif
}
// it keeps backwards compatibility