gpioService - changeCallBack gets called while the pin state doesn't change

my application runs on a custom board with WP76xx and a Legato system based upon 18.08.
I’ve built gpioService with debug information.
My application configures a WP76xx GPIO pin as an input pin, and adds a changeCallBack handler that gets triggered on both edge changes.
When the input pin signal gets triggered (via a button), my log information shows the consecutive state values.
Apparently, the function gpioSysfs_InputMonitorHandlerFunc gets called more than once even with the same pin state value.

I do not understand why the callback handler is triggered different times for the same pin value when it is configured on both edges.


gpiosysfs_logfile (2.6 KB)

WP76_GPIO_source (786 Bytes)

Hello @annaertd, Can you check if there is a change in gpio value when the callback handler gets triggered by issuing cat /sys/class/gpio/gpioxy/value (replace the xy with the gpioPin#) ?
You can also refer to the sample code available at GPIO Sample.


I’ve used cat /sys/class/gpio/gpio7/value to check the value of pin 7 when I toggle the connected button.
The value is 0 or 1 depending on the pressed or released status of my button.
The callback handler gets triggered and shows the same value as the cat command.

But, the question stays:
when the button is pressed and hold down, the callback handler gets triggered 2, 3, 4 or more times and it returns always the same value.
The callback handler is configured for both pin edges, so, I would expect that it only gets triggered each time the pin state value is changing.

In case of a debouncing issue, I understand that a callback handler can get triggered several times, but, then the returned value would toggle each time (eg 0 1 0 1 0 1 0 …)


Hello @annaertd, Can you share your observations after executing the application on a mangoH board? I executed the GPIO Sample app on mangoH red by configuring the call back handler for both Edges but did not find the issue that you mentioned.