Skip to content

Commit b64f4f9

Browse files
robert-hhdpgeorge
authored andcommitted
tests/extmod_hardware/machine_encoder.py: Add a MIMXRT configuration.
For Teensy 4.x. The connectivity tests and the falling edge of the counter test are skipped. Signed-off-by: robert-hh <robert@hammelrath.com>
1 parent 655dc9f commit b64f4f9

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

tests/extmod_hardware/machine_counter.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
id = 0
1717
out_pin = 4
1818
in_pin = 5
19+
elif sys.platform == "mimxrt":
20+
if "Teensy" in sys.implementation._machine:
21+
id = 0
22+
out_pin = "D2"
23+
in_pin = "D3"
1924
else:
2025
print("Please add support for this test on this platform.")
2126
raise SystemExit
@@ -43,6 +48,7 @@ def tearDown(self):
4348
def assertCounter(self, value):
4449
self.assertEqual(self.counter.value(), value)
4550

51+
@unittest.skipIf(sys.platform == "mimxrt", "cannot read back the pin")
4652
def test_connections(self):
4753
# Test the hardware connections are correct. If this test fails, all tests will fail.
4854
out_pin(1)
@@ -73,6 +79,7 @@ def test_change_directions(self):
7379
toggle(25)
7480
self.assertCounter(75)
7581

82+
@unittest.skipIf(sys.platform == "mimxrt", "FALLING edge not supported")
7683
def test_count_falling(self):
7784
self.counter.init(in_pin, direction=Counter.UP, edge=Counter.FALLING)
7885
toggle(20)

tests/target_wiring/mimxrt.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@
77
uart_loopback_kwargs = {}
88

99
spi_standalone_args_list = [()]
10+
11+
encoder_loopback_id = 0
12+
encoder_loopback_out_pins = ("D0", "D2")
13+
encoder_loopback_in_pins = ("D1", "D3")

0 commit comments

Comments
 (0)