Skip to content

Commit

Permalink
refactor shared alarm methods
Browse files Browse the repository at this point in the history
  • Loading branch information
MabezDev committed Jun 9, 2022
1 parent 8f445d8 commit eb13597
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion esp-hal-common/src/systimer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ pub struct Alarm<MODE, const CHANNEL: u8> {
_pd: PhantomData<MODE>,
}

impl<const CHANNEL: u8> Alarm<Target, CHANNEL> {
impl<T, const CHANNEL: u8> Alarm<T, CHANNEL> {
// private constructor
fn new() -> Self {
Self { _pd: PhantomData }
}
Expand Down Expand Up @@ -95,7 +96,9 @@ impl<const CHANNEL: u8> Alarm<Target, CHANNEL> {
_ => unreachable!(),
}
}
}

impl<const CHANNEL: u8> Alarm<Target, CHANNEL> {
pub fn set_target(&self, timestamp: u64) {
unsafe {
let systimer = &*SYSTIMER::ptr();
Expand Down

0 comments on commit eb13597

Please sign in to comment.