diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-03-15 03:14:07 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-03-15 03:14:07 +0000 |
| commit | cb1be3983a47029e0e6a1c07082dd6ed18eda2a7 (patch) | |
| tree | 50fb3b7175ceb0063dc440ec7221ff8399532981 /tests | |
| parent | ff1215c6f9295d960c5111d30f27ca047605414d (diff) | |
| parent | 1dc618f0e4e045de63007893fb36fcaba82acfa4 (diff) | |
Merge #666
666: stm32/spi: Clear rx fifo in blocking methods r=Dirbaio a=GrantM11235
Co-authored-by: Grant Miller <[email protected]>
Co-authored-by: Dario Nieuwenhuis <[email protected]>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/stm32/src/bin/spi_dma.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/stm32/src/bin/spi_dma.rs b/tests/stm32/src/bin/spi_dma.rs index 3e9521ae7..f4f1994c0 100644 --- a/tests/stm32/src/bin/spi_dma.rs +++ b/tests/stm32/src/bin/spi_dma.rs | |||
| @@ -68,6 +68,22 @@ async fn main(_spawner: Spawner, p: Peripherals) { | |||
| 68 | spi.read::<u8>(&mut []).await.unwrap(); | 68 | spi.read::<u8>(&mut []).await.unwrap(); |
| 69 | spi.write::<u8>(&[]).await.unwrap(); | 69 | spi.write::<u8>(&[]).await.unwrap(); |
| 70 | 70 | ||
| 71 | // === Check mixing blocking with async. | ||
| 72 | spi.blocking_transfer(&mut buf, &data).unwrap(); | ||
| 73 | assert_eq!(buf, data); | ||
| 74 | spi.transfer(&mut buf, &data).await.unwrap(); | ||
| 75 | assert_eq!(buf, data); | ||
| 76 | spi.blocking_write(&buf).unwrap(); | ||
| 77 | spi.transfer(&mut buf, &data).await.unwrap(); | ||
| 78 | assert_eq!(buf, data); | ||
| 79 | spi.blocking_read(&mut buf).unwrap(); | ||
| 80 | spi.blocking_write(&buf).unwrap(); | ||
| 81 | spi.write(&buf).await.unwrap(); | ||
| 82 | spi.read(&mut buf).await.unwrap(); | ||
| 83 | spi.blocking_write(&buf).unwrap(); | ||
| 84 | spi.blocking_read(&mut buf).unwrap(); | ||
| 85 | spi.write(&buf).await.unwrap(); | ||
| 86 | |||
| 71 | info!("Test OK"); | 87 | info!("Test OK"); |
| 72 | cortex_m::asm::bkpt(); | 88 | cortex_m::asm::bkpt(); |
| 73 | } | 89 | } |
