test/extmod: Fix machine_spi_rate test on ESP32-C3.

Update to the test added in 1e98c4cb75,
changes the SPI pins for ESP32-C3 (IO 18 and 19 are the native USB pins).

Signed-off-by: Angus Gratton <angus@redyak.com.au>
This commit is contained in:
Angus Gratton
2024-08-14 14:20:36 +10:00
committed by Damien George
parent a6fa85d8f9
commit fb4ae1eeec

View File

@@ -21,11 +21,10 @@ if "pyboard" in sys.platform:
elif "rp2" in sys.platform:
spi_instances = ((0, Pin(18), Pin(19), Pin(16)),)
elif "esp32" in sys.platform:
spi_instances = [
(1, Pin(18), Pin(19), Pin(21)),
]
if "ESP32C3" not in str(sys.implementation):
spi_instances.append((2, Pin(18), Pin(19), Pin(21)))
if "ESP32C3" in str(sys.implementation):
spi_instances = ((1, Pin(4), Pin(5), Pin(6)),)
else:
spi_instances = ((1, Pin(18), Pin(19), Pin(21)), (2, Pin(18), Pin(19), Pin(21)))
else:
print("Please add support for this test on this platform.")
raise SystemExit