Page 1 of 1

Reliably detect edge type on anyedge interrupt

Posted: Mon Aug 02, 2021 5:56 am
by Moriki
Hi, though I saw others asking similiar questions before, I couldn't find a satisfactory answer.

On a gpio with anyedge interrupt type, let's say a button, I want to reliably get info on the interrupt type that triggered the interrupt.
As for now, in my program I debounce the signal, ignoring all interrupts fired after the first interrupt for a millisecond. I am using gpio_get_level and issuing commands. But sometimes it seems that the function returns wrong values.

Is there any efficient and fast way to reliably deduce the interrupt type/level of the gpio in the interrupt context?

Thanks!
Moran