diff --git a/src/syscfg.rs b/src/syscfg.rs index f30928d5..3a564106 100644 --- a/src/syscfg.rs +++ b/src/syscfg.rs @@ -67,10 +67,10 @@ impl SysCfg { /// /// This means, that only on of `PA1`, `PB1`, `PC1`, ... can be activated. /// - /// For example, if first [`crate::gpio::gpioa::PA1`] and than [`crate::gpio::gpiob::PB1`] + /// For example, if first [`crate::gpio::gpioa::PA1`] and then [`crate::gpio::gpiob::PB1`] /// would be configured, the former configuration would be overwritten. /// - /// But configuring `PA1` and and `PB2` works! + /// But configuring `PA1` and `PB2` works! #[doc(alias = "enable_interrupt")] pub fn select_exti_interrupt_source(&mut self, pin: &Pin) where diff --git a/src/timer.rs b/src/timer.rs index 372b1bde..2fac91a3 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -317,7 +317,7 @@ where } /// Wait until [`Event::Update`] / the timer has elapsed - /// and than clear the event. + /// and then clear the event. fn wait(&mut self) -> nb::Result<(), Void> { if self.tim.is_sr_uief_set() { self.clear_event(Event::Update); @@ -328,20 +328,24 @@ where } } -/// Error if a [`Cancel`]-ble [`Timer`] was cancled already or never been started. +/// Error if a [`Cancel`]-ble [`Timer`] was canceled already or never been started. +#[deprecated(note = "Use `AlreadyCanceled` instead of `AlreadyCancled`.")] +pub type AlreadyCancled = AlreadyCanceled; + +/// Error if a [`Cancel`]-ble [`Timer`] was canceled already or never been started. #[derive(Debug, Copy, Clone, PartialEq, Eq)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub struct AlreadyCancled; +pub struct AlreadyCanceled; impl Cancel for Timer where TIM: Instance, { - type Error = AlreadyCancled; + type Error = AlreadyCanceled; fn cancel(&mut self) -> Result<(), Self::Error> { // If timer is already stopped. if !self.tim.is_cr1_cen_set() { - return Err(AlreadyCancled); + return Err(AlreadyCanceled); } self.stop(); Ok(()) diff --git a/testsuite/tests/timer.rs b/testsuite/tests/timer.rs index e142eea3..1af0d325 100644 --- a/testsuite/tests/timer.rs +++ b/testsuite/tests/timer.rs @@ -15,7 +15,7 @@ use hal::hal::timer::Cancel; use hal::interrupts::InterruptNumber; use hal::rcc::{Clocks, APB1}; use hal::time::{duration, fixed_point::FixedPoint}; -use hal::timer::{AlreadyCancled, Event, MonoTimer, Timer}; +use hal::timer::{AlreadyCanceled, Event, MonoTimer, Timer}; use hal::{interrupt, pac, prelude::*}; use pac::TIM2; @@ -125,7 +125,7 @@ mod tests { state.delay.delay_ms(5u32); assert_eq!(timer.cancel(), Ok(())); - assert_eq!(timer.cancel(), Err(AlreadyCancled)); + assert_eq!(timer.cancel(), Err(AlreadyCanceled)); state.timer = Some(timer); }