diff --git a/tests/stm32/src/bin/spi.rs b/tests/stm32/src/bin/spi.rs index 6151058b..b079472d 100644 --- a/tests/stm32/src/bin/spi.rs +++ b/tests/stm32/src/bin/spi.rs @@ -55,6 +55,12 @@ async fn main(_spawner: Spawner, p: Peripherals) { spi.blocking_transfer(&mut buf, &data).unwrap(); assert_eq!(buf, data); + // Check zero-length operations, these should be noops. + spi.blocking_transfer::(&mut [], &[]).unwrap(); + spi.blocking_transfer_in_place::(&mut []).unwrap(); + spi.blocking_read::(&mut []).unwrap(); + spi.blocking_write::(&[]).unwrap(); + info!("Test OK"); cortex_m::asm::bkpt(); } diff --git a/tests/stm32/src/bin/spi_dma.rs b/tests/stm32/src/bin/spi_dma.rs index 67785778..3e9521ae 100644 --- a/tests/stm32/src/bin/spi_dma.rs +++ b/tests/stm32/src/bin/spi_dma.rs @@ -62,6 +62,12 @@ async fn main(_spawner: Spawner, p: Peripherals) { spi.transfer(&mut buf, &data).await.unwrap(); assert_eq!(buf, data); + // Check zero-length operations, these should be noops. + spi.transfer::(&mut [], &[]).await.unwrap(); + spi.transfer_in_place::(&mut []).await.unwrap(); + spi.read::(&mut []).await.unwrap(); + spi.write::(&[]).await.unwrap(); + info!("Test OK"); cortex_m::asm::bkpt(); }