mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 08:12:30 +00:00
Enable clock for RNG
This commit is contained in:
parent
a92d6a372b
commit
f3d1ac6623
@ -24,6 +24,8 @@ pub struct Random<T: Instance> {
|
||||
|
||||
impl<T: Instance> Random<T> {
|
||||
pub fn new(inner: impl Unborrow<Target = T>) -> Self {
|
||||
T::enable();
|
||||
T::reset();
|
||||
unborrow!(inner);
|
||||
let mut random = Self { _inner: inner };
|
||||
random.reset();
|
||||
@ -133,7 +135,7 @@ pub(crate) mod sealed {
|
||||
}
|
||||
}
|
||||
|
||||
pub trait Instance: sealed::Instance {}
|
||||
pub trait Instance: sealed::Instance + crate::rcc::RccPeripheral {}
|
||||
|
||||
crate::pac::peripherals!(
|
||||
(rng, $inst:ident) => {
|
||||
|
Loading…
Reference in New Issue
Block a user