in multiple GPIO events detect only detect minor pin number
A Python module to control the GPIO on a Raspberry Pi
Brought to you by:
croston
Originally created by: tecnicoo...@gmail.com
I add two event detect on two pins:
GPIO.add_event_detect(23, GPIO.FALLING, callback=entrada, bouncetime=20)
GPIO.add_event_detect(24, GPIO.FALLING, callback=salida, bouncetime=20)
When the event occur at the same time, only detects the event at pin 23, ignoring the event at the same time on the pin 24
Package: python-rpi.gpio
Source: rpi.gpio
Version: 0.5.2a-1
I believe this is caused by a bug in event_gpio.c in the function poll_thread where epoll_wait returns more than 1 event, and only the first event is processed, and the other are lost.
I can easily reproduce this problem and will work on submitting a patch to fix it.
Last edit: Terry Hardie 2014-03-24
I added handling to the epoll for multiple events, and epoll still only triggers 1 event. I will need to come up with some other idea...