You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However i had many, many ISR function calls triggered without touching anything. While investigating the issue i found the following bug reports from ESP-IDF link and link.
When i called adc_power_acquire() before attaching the interrupt everything worked (ISR was called twice however). So in the end i used something like this which works perfectly:
void touch_pressed() {
static unsigned long last_interrupt_time = 0;
unsigned long interrupt_time = millis();
// If interrupts come faster than 200ms, assume it's a bounce and ignore
if (interrupt_time - last_interrupt_time > 200) {
// do stuff like notifying a task or so
last_interrupt_time = interrupt_time;
}
}
The text was updated successfully, but these errors were encountered:
Hi,
this is less a bug report but a info for people having the same problem as I had.
I tried to use GPIO36 as interrupt for touch detection instead of polling all the time, since i am using multiple tasks:
attachInterrupt(GPIO_NUM_36, touch_pressed, FALLING);
However i had many, many ISR function calls triggered without touching anything. While investigating the issue i found the following bug reports from ESP-IDF link and link.
When i called
adc_power_acquire()
before attaching the interrupt everything worked (ISR was called twice however). So in the end i used something like this which works perfectly:The text was updated successfully, but these errors were encountered: