diff --git a/src/machine/machine_rp2040_spi.go b/src/machine/machine_rp2040_spi.go index 07a3745ea7..cb60fdbcb0 100644 --- a/src/machine/machine_rp2040_spi.go +++ b/src/machine/machine_rp2040_spi.go @@ -368,6 +368,9 @@ func (spi SPI) rx(rx []byte, txrepeat byte) error { continue } } + for spi.isBusy() { + gosched() + } return nil } @@ -397,6 +400,8 @@ func (spi SPI) txrx(tx, rx []byte) error { // Transaction ended early due to timeout return ErrSPITimeout } - + for spi.isBusy() { + gosched() + } return nil }