aboutsummaryrefslogtreecommitdiff
path: root/tests/stm32/src
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2024-05-20 23:41:02 +0200
committerDario Nieuwenhuis <[email protected]>2024-05-20 23:43:10 +0200
commit2b09f9efd7e621708cd00bc512ce981735907103 (patch)
treedcccf3b4bfec255a47fcf256f22cfa7ad87c59ff /tests/stm32/src
parentca2eef5387b521a0ea95f26bae530d9bdfbba4d7 (diff)
stm32/spi: check that the RCC enable bit is disabled on drop.
Diffstat (limited to 'tests/stm32/src')
-rw-r--r--tests/stm32/src/bin/spi.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/stm32/src/bin/spi.rs b/tests/stm32/src/bin/spi.rs
index 59cb0cfd3..c1576bfeb 100644
--- a/tests/stm32/src/bin/spi.rs
+++ b/tests/stm32/src/bin/spi.rs
@@ -58,6 +58,14 @@ async fn main(_spawner: Spawner) {
58 spi.blocking_read::<u8>(&mut []).unwrap(); 58 spi.blocking_read::<u8>(&mut []).unwrap();
59 spi.blocking_write::<u8>(&[]).unwrap(); 59 spi.blocking_write::<u8>(&[]).unwrap();
60 60
61 // Assert the RCC bit gets disabled on drop.
62 #[cfg(feature = "stm32f429zi")]
63 {
64 defmt::assert!(embassy_stm32::pac::RCC.apb2enr().read().spi1en());
65 drop(spi);
66 defmt::assert!(!embassy_stm32::pac::RCC.apb2enr().read().spi1en());
67 }
68
61 info!("Test OK"); 69 info!("Test OK");
62 cortex_m::asm::bkpt(); 70 cortex_m::asm::bkpt();
63} 71}