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


#1

Hi,
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.

greetings,
annaertd

gpiosysfs_logfile (2.6 KB)

WP76_GPIO_source (786 Bytes)


#2

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.


#3

Hi,

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 …)

greetings,
annaertd


#4

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)