Skip to content

Commit

Permalink
Merge pull request #705 from makermelissa/odroidn2-fix
Browse files Browse the repository at this point in the history
Add check to ODroid n2 to make sure i2c matches expected ports
  • Loading branch information
makermelissa committed Sep 11, 2023
2 parents 1d3ac2a + 60fb6ab commit 4f8d7fa
Showing 1 changed file with 8 additions and 2 deletions.
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

0 comments on commit 4f8d7fa

Please sign in to comment.