Skip to content

Commit

Permalink
Merge pull request #917 from adafruit/use-pi5-pio-neopixel
Browse files Browse the repository at this point in the history
neopixel_write: Use new pio-based code on pi5
  • Loading branch information
ladyada authored Dec 16, 2024
2 parents b91d3fc + a7ebb56 commit 1126135
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
board_reqs = ["RPi.GPIO", "rpi_ws281x>=4.0.0"]
# Pi 5
if b"brcm,bcm2712" in compat:
board_reqs = ["rpi_ws281x>=4.0.0", "rpi-lgpio"]
board_reqs = [
"rpi_ws281x>=4.0.0",
"rpi-lgpio",
"Adafruit-Blinka-Raspberry-Pi5-Neopixel",
]
if (
b"ti,am335x" in compat
): # BeagleBone Black, Green, PocketBeagle, BeagleBone AI, etc.
Expand Down
9 changes: 6 additions & 3 deletions src/neopixel_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@
* Author(s): ladyada
"""
# pylint: disable=too-many-boolean-expressions
# pylint: disable=too-many-boolean-expressions, ungrouped-imports
import sys

from adafruit_blinka.agnostic import detector
from adafruit_blinka.agnostic import detector, board_id

if detector.board.any_raspberry_pi:
from adafruit_blinka.microcontroller.bcm283x import neopixel as _neopixel
if board_id == "RASPBERRY_PI_5":
import adafruit_raspberry_pi5_neopixel_write as _neopixel
else:
from adafruit_blinka.microcontroller.bcm283x import neopixel as _neopixel
elif detector.board.pico_u2if:
from adafruit_blinka.microcontroller.rp2040_u2if import neopixel as _neopixel
elif detector.board.OS_AGNOSTIC_BOARD:
Expand Down

0 comments on commit 1126135

Please sign in to comment.