Skip to content

Commit

Permalink
i2c scan and fake_mcp
Browse files Browse the repository at this point in the history
  • Loading branch information
brentru committed Apr 2, 2024
1 parent 0e0e0f1 commit 11d8e60
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/busio.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Author(s): cefn
"""
import os

try:
import threading
Expand Down Expand Up @@ -50,8 +51,10 @@ def init(self, scl, sda, frequency):
self._i2c = _I2C(frequency=frequency)
return
if detector.board.microchip_mcp2221:
from adafruit_blinka.microcontroller.mcp2221.i2c import I2C as _I2C

if "BLINKA_FORCEBOARD" not in os.environ:
from adafruit_blinka.microcontroller.mcp2221.i2c import I2C as _I2C
elif os.environ["BLINKA_FORCEBOARD"] == "MICROCHIP_MCP2221":
from adafruit_blinka.microcontroller.fake_mcp2221.i2c import I2C as _I2C
self._i2c = _I2C(frequency=frequency)
return
if detector.board.greatfet_one:
Expand Down

0 comments on commit 11d8e60

Please sign in to comment.