Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check to ODroid n2 to make sure i2c matches expected ports #705

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/adafruit_blinka/board/hardkernel/odroidn2.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,15 @@
globals()["SCL" + str(it[0])] = it[1]
globals()["SDA" + str(it[0])] = it[2]

SCL = None
SDA = None
# Set second i2c bus as default for backward compatibility.
SCL = pin.i2cPorts[1][1]
SDA = pin.i2cPorts[1][2]
if len(pin.i2cPorts) > 1:
SCL = pin.i2cPorts[1][1]
SDA = pin.i2cPorts[1][2]
elif len(pin.i2cPorts) > 0:
SCL = pin.i2cPorts[0][1]
SDA = pin.i2cPorts[0][2]

SCLK = pin.SPI0_SCLK
MOSI = pin.SPI0_MOSI
Expand Down