Skip to content

Commit

Permalink
Make clone_unchecked work
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantM11235 committed Sep 21, 2024
1 parent df06c2b commit f2646b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions embassy-stm32/src/timer/low_level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,7 @@ impl<'d, T: CoreInstance> Timer<'d, T> {
}

pub(crate) unsafe fn clone_unchecked(&self) -> ManuallyDrop<Self> {
// this doesn't work for some reason
// let tim = unsafe { self.tim.clone_unchecked() };
let tim = todo!();
let tim = unsafe { self.tim.clone_unchecked() };
ManuallyDrop::new(Self { tim })
}

Expand Down
2 changes: 1 addition & 1 deletion embassy-stm32/src/timer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl State {
}
}

trait SealedInstance: RccPeripheral {
trait SealedInstance: RccPeripheral + Peripheral<P = Self> {
/// Async state for this timer
fn state() -> &'static State;
}
Expand Down

0 comments on commit f2646b2

Please sign in to comment.