diff options
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 | } |
