diff options
| author | Grant Miller <[email protected]> | 2024-09-21 07:52:54 -0500 |
|---|---|---|
| committer | Grant Miller <[email protected]> | 2024-09-21 07:52:54 -0500 |
| commit | f2646b29a6b0a741fc424f88c5ca3dc25fce9369 (patch) | |
| tree | 86e34b73419f069c274b8d11e91ca2c249a09170 | |
| parent | df06c2bbfe51e22e0d3eda3d760839f617ffbd96 (diff) | |
Make clone_unchecked work
| -rw-r--r-- | embassy-stm32/src/timer/low_level.rs | 4 | ||||
| -rw-r--r-- | 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> { | |||
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | pub(crate) unsafe fn clone_unchecked(&self) -> ManuallyDrop<Self> { | 203 | pub(crate) unsafe fn clone_unchecked(&self) -> ManuallyDrop<Self> { |
| 204 | // this doesn't work for some reason | 204 | let tim = unsafe { self.tim.clone_unchecked() }; |
| 205 | // let tim = unsafe { self.tim.clone_unchecked() }; | ||
| 206 | let tim = todo!(); | ||
| 207 | ManuallyDrop::new(Self { tim }) | 205 | ManuallyDrop::new(Self { tim }) |
| 208 | } | 206 | } |
| 209 | 207 | ||
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 { | |||
| 67 | } | 67 | } |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | trait SealedInstance: RccPeripheral { | 70 | trait SealedInstance: RccPeripheral + Peripheral<P = Self> { |
| 71 | /// Async state for this timer | 71 | /// Async state for this timer |
| 72 | fn state() -> &'static State; | 72 | fn state() -> &'static State; |
| 73 | } | 73 | } |
