diff options
author | soypat <[email protected]> | 2023-06-11 15:03:45 -0300 |
---|---|---|
committer | Ayke <[email protected]> | 2023-06-11 22:24:26 +0200 |
commit | d01d85930d19a73010853b7ba8648d8811891bee (patch) | |
tree | 61ec74404480d61079e7ed82b8e6d4d464a07585 | |
parent | ac821d8295c6148b71a5e67f6f0d81732722ed2f (diff) | |
download | tinygo-0.28.1.tar.gz tinygo-0.28.1.zip |
rp2040: add spi busy waits on read and read/write transactionsv0.28.1
-rw-r--r-- | src/machine/machine_rp2040_spi.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/machine/machine_rp2040_spi.go b/src/machine/machine_rp2040_spi.go index 07a3745ea..cb60fdbcb 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 } |