From 74bbf5aa02a10efce498054ad436a6140540f917 Mon Sep 17 00:00:00 2001 From: Vincent Stakenburg Date: Fri, 24 Jun 2022 14:19:29 +0200 Subject: [PATCH] address review --- embassy-stm32/src/wdg/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/embassy-stm32/src/wdg/mod.rs b/embassy-stm32/src/wdg/mod.rs index 4353c403b..8d2663d94 100644 --- a/embassy-stm32/src/wdg/mod.rs +++ b/embassy-stm32/src/wdg/mod.rs @@ -2,9 +2,7 @@ use core::marker::PhantomData; use embassy::util::Unborrow; use embassy_hal_common::unborrow; - use stm32_metapac::iwdg::vals::Key; - pub use stm32_metapac::iwdg::vals::Pr as Prescaler; pub struct IndependentWatchdog<'d, T: Instance> { @@ -12,7 +10,7 @@ pub struct IndependentWatchdog<'d, T: Instance> { } impl<'d, T: Instance> IndependentWatchdog<'d, T> { - pub fn new(_instance: impl Unborrow, presc: Prescaler) -> Self { + pub fn new(_instance: impl Unborrow + 'd, presc: Prescaler) -> Self { unborrow!(_instance); 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)); } - pub unsafe fn feed(&mut self) { + pub unsafe fn pet(&mut self) { T::regs().kr().write(|w| w.set_key(Key::RESET)); } }