aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Stakenburg <[email protected]>2022-06-24 14:19:29 +0200
committerVincent Stakenburg <[email protected]>2022-06-28 12:46:17 +0200
commit74bbf5aa02a10efce498054ad436a6140540f917 (patch)
tree548cabf49a160c92baa1bf0d88e2a630917d6ebc
parent5cf3fbece4adcf8d1d4475593ab9d6caf1e30f62 (diff)
address review
-rw-r--r--embassy-stm32/src/wdg/mod.rs6
1 files 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;
2 2
3use embassy::util::Unborrow; 3use embassy::util::Unborrow;
4use embassy_hal_common::unborrow; 4use embassy_hal_common::unborrow;
5
6use stm32_metapac::iwdg::vals::Key; 5use stm32_metapac::iwdg::vals::Key;
7
8pub use stm32_metapac::iwdg::vals::Pr as Prescaler; 6pub use stm32_metapac::iwdg::vals::Pr as Prescaler;
9 7
10pub struct IndependentWatchdog<'d, T: Instance> { 8pub struct IndependentWatchdog<'d, T: Instance> {
@@ -12,7 +10,7 @@ pub struct IndependentWatchdog<'d, T: Instance> {
12} 10}
13 11
14impl<'d, T: Instance> IndependentWatchdog<'d, T> { 12impl<'d, T: Instance> IndependentWatchdog<'d, T> {
15 pub fn new(_instance: impl Unborrow<Target = T>, presc: Prescaler) -> Self { 13 pub fn new(_instance: impl Unborrow<Target = T> + 'd, presc: Prescaler) -> Self {
16 unborrow!(_instance); 14 unborrow!(_instance);
17 15
18 let wdg = T::regs(); 16 let wdg = T::regs();
@@ -30,7 +28,7 @@ impl<'d, T: Instance> IndependentWatchdog<'d, T> {
30 T::regs().kr().write(|w| w.set_key(Key::START)); 28 T::regs().kr().write(|w| w.set_key(Key::START));
31 } 29 }
32 30
33 pub unsafe fn feed(&mut self) { 31 pub unsafe fn pet(&mut self) {
34 T::regs().kr().write(|w| w.set_key(Key::RESET)); 32 T::regs().kr().write(|w| w.set_key(Key::RESET));
35 } 33 }
36} 34}