Closed cquick01 closed 7 months ago
Argh, the first commit is definitely a bug that needs fixing. Kicking myself that I didn't spot that one.
Unfortunately, I can't accept the second commit because it's not "bug compatible" with RPi.GPIO. If you have a look at RPi.GPIO's code it doesn't include GPIO0 or 1 in the BOARD mapping and if you try and use those GPIOs from that mode it fails (the following is the "real" RPi.GPIO on a Pi 4 under Ubuntu jammy):
>>> from RPi import GPIO
>>> GPIO.setmode(GPIO.BOARD)
>>> GPIO.gpio_function(27)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: The channel sent is invalid on a Raspberry Pi
You can still use GPIO 0 and 1 from the BCM mode quite happily of course, and the same is true under rpi-lgpio, but I can't justify making any deliberate differences between this and RPi.GPIO.
Thanks for grabbing the first commit, and for that info! I'll see about using BCM mode in my code instead
Fixes an exception seen when trying to initialize pins
Also updates the pin map to allow configuring GPIO 0 and 1. I've been using a little patch at the top of my script using
rpi-lgpio
, which works perfectly with my Pi 5