mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 08:12:30 +00:00
stm32/spi: check that the RCC enable bit is disabled on drop.
This commit is contained in:
parent
ca2eef5387
commit
2b09f9efd7
@ -58,6 +58,14 @@ async fn main(_spawner: Spawner) {
|
|||||||
spi.blocking_read::<u8>(&mut []).unwrap();
|
spi.blocking_read::<u8>(&mut []).unwrap();
|
||||||
spi.blocking_write::<u8>(&[]).unwrap();
|
spi.blocking_write::<u8>(&[]).unwrap();
|
||||||
|
|
||||||
|
// Assert the RCC bit gets disabled on drop.
|
||||||
|
#[cfg(feature = "stm32f429zi")]
|
||||||
|
{
|
||||||
|
defmt::assert!(embassy_stm32::pac::RCC.apb2enr().read().spi1en());
|
||||||
|
drop(spi);
|
||||||
|
defmt::assert!(!embassy_stm32::pac::RCC.apb2enr().read().spi1en());
|
||||||
|
}
|
||||||
|
|
||||||
info!("Test OK");
|
info!("Test OK");
|
||||||
cortex_m::asm::bkpt();
|
cortex_m::asm::bkpt();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user