-
-
Notifications
You must be signed in to change notification settings - Fork 147
BOARD numbering with interrupts #6
Comments
same for me. |
Thanks for the feedback. I'll be taking a look into it tomorrow! |
Have encountered the same issue still. Oct 2013. |
Still seeing this issue. I'm trying to use GPIO 25 (BOARD 22), and getting the same exception. I've tried it out and found that BOARD pins 3, 7, 8, 11, 21, 22 Yield the 'not a valid pin' version of the exception BOARD pin 13 gives the 'outside of range' version of the exception The following board pins seem to initialize fine: 5, 10, 12, 15, 16, 18, 23, 24. This is a really frustrating problem, and I don't know your code well (so forgive my presumption), but I think the evidence points to an answer. In _RPIO.py (within the add_interrupt_callback() definition) on line 125 you translate from whatever numbering system was established by RPIO.setmode() to the proper GPIO numbers (BCM) by calling channel_to_gpio(), the exception isn't thrown there. Then on line 139 of _RPIO.py you call RPIO.gpio_function(), passing the (now BCM) gpio_id; within py_gpio_function() you take that gpio_id (which is using the BCM numbering) and you pass it again to channel_to_gpio(), this is where the error is thrown because that function expects the gpio_id to be relative to RPIO.BOARD (since that is still the set mode). Perhaps if you pass the unmolested channel_id to RPIO.gpio_function() on line 139 rather than the gpio_id it will work. |
Is it currently possible to use the BOARD numbering scheme with interrupts? It doesn't currently seem to work.
I tried to set an interrupt on GPIO 2 (BOARD 3). When using
RPIO.setmode(RPIO.BOARD)
and add an interrupt callback to pin 3, I get anInvalidChannelException
("not a valid pin").With
RPIO.BCM
and pin 2 it works though. Which is a little strange as pin 3 would be a valid GPIO pin with BCM numbering too.Is this some bug? Do the interrupts not support the BOARD numbering?
The text was updated successfully, but these errors were encountered: