Hi, working on a motion detector and I believe there may be a flaw in the logic of GPIO.C
in GPIO.C function gpio_intr_handler, should this line
if ( (0x1<<i) & gpio_status & gpio_intr_callbacks[i]!= NULL ){
not be
if ( (0x1<<i) & gpio_status && gpio_intr_callbacks[i]!= NULL ){
i.e. the second and should be a logical and, not a bitwise and. I was having problems getting interrupts to fire, so I added some debug trace, with the original I get this:-
checking GPIO 2, 0x1<<i=4 , gpio_status=4, callback=4024c940
no match
with the revised code I get:-
checking GPIO 2, 0x1<<i=4 , gpio_status=4, callback=4024c940
called interupt handler for GPIO 2
Hi, working on a motion detector and I believe there may be a flaw in the logic of GPIO.C
in GPIO.C function gpio_intr_handler, should this line
not be
i.e. the second and should be a logical and, not a bitwise and. I was having problems getting interrupts to fire, so I added some debug trace, with the original I get this:-
with the revised code I get:-
TIA for your thoughts