summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Dale Smith <[email protected]>2026-03-03 23:01:14 -0600
committerRobert Dale Smith <[email protected]>2026-03-03 23:01:14 -0600
commit70eb68982309df4bd769958d8bad6a3ed9a526d9 (patch)
tree9462bef9671aa1196333d0fbf1e6544dea58ab67
parent331c263400dd5ccf77264cab1fa6bbd9f374b44e (diff)
fix(bsp/rp2040): use MAX3421_SPI in spi_write_read_blocking
The write+read path in tuh_max3421_spi_xfer_api() hardcodes spi0 instead of using the MAX3421_SPI define. This causes a hang on boards wired to spi1 (e.g. Feather RP2040 USB Host + MAX3421E FeatherWing) since spi_write_read_blocking() blocks forever on an uninitialized SPI peripheral. The read-only and write-only paths already use MAX3421_SPI correctly.
-rw-r--r--hw/bsp/rp2040/family.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/bsp/rp2040/family.c b/hw/bsp/rp2040/family.c
index 989140e02..59e07e7f2 100644
--- a/hw/bsp/rp2040/family.c
+++ b/hw/bsp/rp2040/family.c
@@ -368,7 +368,7 @@ bool tuh_max3421_spi_xfer_api(uint8_t rhport, uint8_t const* tx_buf, uint8_t* rx
}else if (rx_buf == NULL) {
ret = spi_write_blocking(MAX3421_SPI, tx_buf, xfer_bytes);
}else {
- ret = spi_write_read_blocking(spi0, tx_buf, rx_buf, xfer_bytes);
+ ret = spi_write_read_blocking(MAX3421_SPI, tx_buf, rx_buf, xfer_bytes);
}
return ret == (int) xfer_bytes;