From f2646b29a6b0a741fc424f88c5ca3dc25fce9369 Mon Sep 17 00:00:00 2001 From: Grant Miller Date: Sat, 21 Sep 2024 07:52:54 -0500 Subject: [PATCH] Make clone_unchecked work --- embassy-stm32/src/timer/low_level.rs | 4 +--- embassy-stm32/src/timer/mod.rs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/embassy-stm32/src/timer/low_level.rs b/embassy-stm32/src/timer/low_level.rs index 6377054c5..3136ea4e9 100644 --- a/embassy-stm32/src/timer/low_level.rs +++ b/embassy-stm32/src/timer/low_level.rs @@ -201,9 +201,7 @@ impl<'d, T: CoreInstance> Timer<'d, T> { } pub(crate) unsafe fn clone_unchecked(&self) -> ManuallyDrop { - // 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 }) } diff --git a/embassy-stm32/src/timer/mod.rs b/embassy-stm32/src/timer/mod.rs index 6cf22689b..aa9dd91d9 100644 --- a/embassy-stm32/src/timer/mod.rs +++ b/embassy-stm32/src/timer/mod.rs @@ -67,7 +67,7 @@ impl State { } } -trait SealedInstance: RccPeripheral { +trait SealedInstance: RccPeripheral + Peripheral

{ /// Async state for this timer fn state() -> &'static State; }