diff options
| author | Ihor Nehrutsa <Ihor.Nehrutsa@gmail.com> | 2025-09-19 13:04:37 +0300 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-11-19 16:10:12 +1100 |
| commit | 094437686fc53727318eea82e5609106c26e882a (patch) | |
| tree | d72a1b397cddef76e92e438f7f05d88108135922 | |
| parent | d980bbd23717d504b8be8613e119467ca2136b2b (diff) | |
tests/extmod_hardware/machine_encoder.py: Use target_wiring for encoder.
Signed-off-by: Ihor Nehrutsa <Ihor.Nehrutsa@gmail.com>
| -rw-r--r-- | tests/extmod_hardware/machine_encoder.py | 16 | ||||
| -rwxr-xr-x | tests/run-tests.py | 1 | ||||
| -rw-r--r-- | tests/target_wiring/esp32.py | 5 |
3 files changed, 11 insertions, 11 deletions
diff --git a/tests/extmod_hardware/machine_encoder.py b/tests/extmod_hardware/machine_encoder.py index f28eb6de6..c218c8bfb 100644 --- a/tests/extmod_hardware/machine_encoder.py +++ b/tests/extmod_hardware/machine_encoder.py @@ -11,22 +11,16 @@ except ImportError: raise SystemExit import sys +import unittest from machine import Pin +from target_wiring import encoder_loopback_id, encoder_loopback_out_pins, encoder_loopback_in_pins PRINT = False PIN_INIT_VALUE = 1 -if "esp32" in sys.platform: - id = 0 - out0_pin = 4 - in0_pin = 5 - out1_pin = 12 - in1_pin = 13 -else: - print("Please add support for this test on this platform.") - raise SystemExit - -import unittest +id = encoder_loopback_id +out0_pin, out1_pin = encoder_loopback_out_pins +in0_pin, in1_pin = encoder_loopback_in_pins out0_pin = Pin(out0_pin, mode=Pin.OUT) in0_pin = Pin(in0_pin, mode=Pin.IN) diff --git a/tests/run-tests.py b/tests/run-tests.py index d8d2c42ad..b4654c2e6 100755 --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -309,6 +309,7 @@ tests_requiring_slice = ( tests_requiring_target_wiring = ( "extmod/machine_uart_irq_txidle.py", "extmod/machine_uart_tx.py", + "extmod_hardware/machine_encoder.py", "extmod_hardware/machine_uart_irq_break.py", "extmod_hardware/machine_uart_irq_rx.py", "extmod_hardware/machine_uart_irq_rxidle.py", diff --git a/tests/target_wiring/esp32.py b/tests/target_wiring/esp32.py index 63d7a81a2..2767cd5ac 100644 --- a/tests/target_wiring/esp32.py +++ b/tests/target_wiring/esp32.py @@ -2,6 +2,11 @@ # # Connect: # - GPIO4 to GPIO5 +# - GPIO12 to GPIO13 uart_loopback_args = (1,) uart_loopback_kwargs = {"tx": 4, "rx": 5} + +encoder_loopback_id = 0 +encoder_loopback_out_pins = (4, 12) +encoder_loopback_in_pins = (5, 13) |
