Skip to content
Commit 8a99bd0d authored by Benjamin Valentin's avatar Benjamin Valentin Committed by Kumar Gala
Browse files

drivers: spi: spi_sam0: fix spi_sam0_fast_txrx()



The optimisation in `spi_sam0_fast_txrx()` is broken, loading
two bytes into the `DATA` register in rapid succession will lose
one byte.

This can be observed by running `tests/drivers/spi/spi_loopback`.
The test will get stuck in `spi_sam0_fast_txrx()` forever waiting
for the final byte.

Undo this small optimisation and only load the next byte into the
`DATA` register after the response has been received.

This fixes `tests/drivers/spi/spi_loopback`.

Signed-off-by: default avatarBenjamin Valentin <benpicco@googlemail.com>
parent 52a950bb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment