I am trying to figure out GPIO and interrupts.  So the situation is I have four 
switches connected to GPIOs on my board.  My ideal scenario is to attach a 
different interrupt to each switch and have that fired when the appropriate 
button is pressed.

So I have spent some time looking at the gpis_main.c file and I have changed 
the code that sets the event to:

notify.sigev_notify = SIGEV_THREAD;
notify.sigev_notify_function = sigev_notify_function;


And I am getting the interrupt for one button as expected.  Too many interrupts 
in fact - I have debounced the input in hardware using a 555 so the signal 
should be good.

I am struggling to work out how to do this for the remaining buttons without 
spinning up multiple threads all effectively running the same code but with 
different devices.

I came across the buttons example but this appears to be disabled for this 
board.

Any advice would be gratefully received.

Regards,
Mark
_____________________________
Blog: blog.thepcsite.co.uk
Twitter: @nevynuk





Reply via email to