address review

This commit is contained in:
Vincent Stakenburg 2022-06-24 14:19:29 +02:00
parent 5cf3fbece4
commit 74bbf5aa02

View File

@ -2,9 +2,7 @@ use core::marker::PhantomData;
use embassy::util::Unborrow; use embassy::util::Unborrow;
use embassy_hal_common::unborrow; use embassy_hal_common::unborrow;
use stm32_metapac::iwdg::vals::Key; use stm32_metapac::iwdg::vals::Key;
pub use stm32_metapac::iwdg::vals::Pr as Prescaler; pub use stm32_metapac::iwdg::vals::Pr as Prescaler;
pub struct IndependentWatchdog<'d, T: Instance> { pub struct IndependentWatchdog<'d, T: Instance> {
@ -12,7 +10,7 @@ pub struct IndependentWatchdog<'d, T: Instance> {
} }
impl<'d, T: Instance> IndependentWatchdog<'d, T> { impl<'d, T: Instance> IndependentWatchdog<'d, T> {
pub fn new(_instance: impl Unborrow<Target = T>, presc: Prescaler) -> Self { pub fn new(_instance: impl Unborrow<Target = T> + 'd, presc: Prescaler) -> Self {
unborrow!(_instance); unborrow!(_instance);
let wdg = T::regs(); let wdg = T::regs();
@ -30,7 +28,7 @@ impl<'d, T: Instance> IndependentWatchdog<'d, T> {
T::regs().kr().write(|w| w.set_key(Key::START)); T::regs().kr().write(|w| w.set_key(Key::START));
} }
pub unsafe fn feed(&mut self) { pub unsafe fn pet(&mut self) {
T::regs().kr().write(|w| w.set_key(Key::RESET)); T::regs().kr().write(|w| w.set_key(Key::RESET));
} }
} }