From 70eb68982309df4bd769958d8bad6a3ed9a526d9 Mon Sep 17 00:00:00 2001 From: Robert Dale Smith Date: Tue, 3 Mar 2026 23:01:14 -0600 Subject: 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. --- hw/bsp/rp2040/family.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.3.1