hack for STM32WL, rcc reset in case of seed error

The STM32WL series has a more complicated rng device that gets stuck
when there is a seed error.
This commit is contained in:
Lucas Granberg 2023-02-08 17:57:37 +02:00
parent da6b1e8399
commit bab4277a86

View File

@ -32,6 +32,11 @@ impl<'d, T: Instance> Rng<'d, T> {
}
pub fn reset(&mut self) {
//stm32wl gets stuck if there is a seed error
#[cfg(stm32wl)]
if unsafe { T::regs().sr().read().seis()} {
T::reset();
}
unsafe {
T::regs().cr().modify(|reg| {
reg.set_rngen(true);