Skip to content

Commit 1126135

Browse files
authored
Merge pull request #917 from adafruit/use-pi5-pio-neopixel
neopixel_write: Use new pio-based code on pi5
2 parents b91d3fc + a7ebb56 commit 1126135

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@
3737
board_reqs = ["RPi.GPIO", "rpi_ws281x>=4.0.0"]
3838
# Pi 5
3939
if b"brcm,bcm2712" in compat:
40-
board_reqs = ["rpi_ws281x>=4.0.0", "rpi-lgpio"]
40+
board_reqs = [
41+
"rpi_ws281x>=4.0.0",
42+
"rpi-lgpio",
43+
"Adafruit-Blinka-Raspberry-Pi5-Neopixel",
44+
]
4145
if (
4246
b"ti,am335x" in compat
4347
): # BeagleBone Black, Green, PocketBeagle, BeagleBone AI, etc.

src/neopixel_write.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@
1010
1111
* Author(s): ladyada
1212
"""
13-
# pylint: disable=too-many-boolean-expressions
13+
# pylint: disable=too-many-boolean-expressions, ungrouped-imports
1414
import sys
1515

16-
from adafruit_blinka.agnostic import detector
16+
from adafruit_blinka.agnostic import detector, board_id
1717

1818
if detector.board.any_raspberry_pi:
19-
from adafruit_blinka.microcontroller.bcm283x import neopixel as _neopixel
19+
if board_id == "RASPBERRY_PI_5":
20+
import adafruit_raspberry_pi5_neopixel_write as _neopixel
21+
else:
22+
from adafruit_blinka.microcontroller.bcm283x import neopixel as _neopixel
2023
elif detector.board.pico_u2if:
2124
from adafruit_blinka.microcontroller.rp2040_u2if import neopixel as _neopixel
2225
elif detector.board.OS_AGNOSTIC_BOARD:

0 commit comments

Comments
 (0)