Add missing + 'd
on unborrows.
This commit is contained in:
@ -1,16 +1,19 @@
|
||||
use core::marker::PhantomData;
|
||||
|
||||
use crate::pac::CRC as PAC_CRC;
|
||||
use crate::peripherals::CRC;
|
||||
use crate::rcc::sealed::RccPeripheral;
|
||||
use embassy::util::Unborrow;
|
||||
use embassy_hal_common::unborrow;
|
||||
|
||||
pub struct Crc {
|
||||
pub struct Crc<'d> {
|
||||
_peripheral: CRC,
|
||||
_phantom: PhantomData<&'d mut CRC>,
|
||||
}
|
||||
|
||||
impl Crc {
|
||||
impl<'d> Crc<'d> {
|
||||
/// Instantiates the CRC32 peripheral and initializes it to default values.
|
||||
pub fn new(peripheral: impl Unborrow<Target = CRC>) -> Self {
|
||||
pub fn new(peripheral: impl Unborrow<Target = CRC> + 'd) -> Self {
|
||||
// Note: enable and reset come from RccPeripheral.
|
||||
// enable CRC clock in RCC.
|
||||
CRC::enable();
|
||||
@ -20,6 +23,7 @@ impl Crc {
|
||||
unborrow!(peripheral);
|
||||
let mut instance = Self {
|
||||
_peripheral: peripheral,
|
||||
_phantom: PhantomData,
|
||||
};
|
||||
instance.reset();
|
||||
instance
|
||||
|
Reference in New Issue
Block a user