Update embassy-stm32

This commit is contained in:
Dario Nieuwenhuis
2022-07-23 01:29:35 +02:00
parent e0521ea249
commit 8a9d2f59af
26 changed files with 433 additions and 361 deletions

View File

@ -1,10 +1,9 @@
#![macro_use]
use core::marker::PhantomData;
use core::task::Poll;
use embassy::waitqueue::AtomicWaker;
use embassy_hal_common::unborrow;
use embassy_hal_common::{unborrow, Unborrowed};
use futures::future::poll_fn;
use rand_core::{CryptoRng, RngCore};
@ -19,8 +18,7 @@ pub enum Error {
}
pub struct Rng<'d, T: Instance> {
_inner: T,
_phantom: PhantomData<&'d mut T>,
_inner: Unborrowed<'d, T>,
}
impl<'d, T: Instance> Rng<'d, T> {
@ -28,10 +26,7 @@ impl<'d, T: Instance> Rng<'d, T> {
T::enable();
T::reset();
unborrow!(inner);
let mut random = Self {
_inner: inner,
_phantom: PhantomData,
};
let mut random = Self { _inner: inner };
random.reset();
random
}