Skip to content

Commit 37fba5f

Browse files
robert-hhdpgeorge
authored andcommitted
tests/extmod_hardware/machine_i2c_target.py: Support MIMXRT and SAMD.
Add settings for these two ports. Signed-off-by: robert-hh <[email protected]>
1 parent ba7449b commit 37fba5f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/extmod_hardware/machine_i2c_target.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@
4141
else:
4242
print("Please add support for this test on this zephyr platform.")
4343
raise SystemExit
44+
elif sys.platform == "mimxrt":
45+
if "Teensy" in sys.implementation._machine:
46+
args_controller = {"scl": "A6", "sda": "A3"}
47+
else:
48+
args_controller = {"scl": "D0", "sda": "D1"}
49+
args_target = (0,)
50+
elif sys.platform == "samd":
51+
args_controller = {"scl": "D5", "sda": "D1"}
52+
args_target = tuple()
4453
else:
4554
print("Please add support for this test on this platform.")
4655
raise SystemExit
@@ -64,7 +73,7 @@ def tearDownClass(cls):
6473
cls.i2c_target.deinit()
6574

6675
def test_scan(self):
67-
self.assertEqual(self.i2c.scan(), [ADDR])
76+
self.assertIn(ADDR, self.i2c.scan())
6877

6978
def test_write(self):
7079
self.mem[:] = b"01234567"

0 commit comments

Comments
 (0)