Skip to content

Commit d01d859

Browse files
soypataykevl
authored andcommitted
rp2040: add spi busy waits on read and read/write transactions
1 parent ac821d8 commit d01d859

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/machine/machine_rp2040_spi.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,9 @@ func (spi SPI) rx(rx []byte, txrepeat byte) error {
368368
continue
369369
}
370370
}
371+
for spi.isBusy() {
372+
gosched()
373+
}
371374
return nil
372375
}
373376

@@ -397,6 +400,8 @@ func (spi SPI) txrx(tx, rx []byte) error {
397400
// Transaction ended early due to timeout
398401
return ErrSPITimeout
399402
}
400-
403+
for spi.isBusy() {
404+
gosched()
405+
}
401406
return nil
402407
}

0 commit comments

Comments
 (0)