diff options
| author | eZio Pan <[email protected]> | 2024-02-02 14:52:54 +0800 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2024-02-10 00:00:43 +0100 |
| commit | b3cdf3a040ae97923e84eca525505f7eff55e870 (patch) | |
| tree | 5845129aefd1d04d5802e7abc8aec0dd8d6b03de /embassy-stm32/src/timer/mod.rs | |
| parent | 319f10da5daff415ad2dac17f4eed43313455167 (diff) | |
bug fix
Diffstat (limited to 'embassy-stm32/src/timer/mod.rs')
| -rw-r--r-- | embassy-stm32/src/timer/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/embassy-stm32/src/timer/mod.rs b/embassy-stm32/src/timer/mod.rs index be5c6cf29..3e303a6cf 100644 --- a/embassy-stm32/src/timer/mod.rs +++ b/embassy-stm32/src/timer/mod.rs | |||
| @@ -90,9 +90,9 @@ pub(crate) mod sealed { | |||
| 90 | 90 | ||
| 91 | /// Set output compare mode. | 91 | /// Set output compare mode. |
| 92 | fn set_output_compare_mode(&mut self, channel: Channel, mode: OutputCompareMode) { | 92 | fn set_output_compare_mode(&mut self, channel: Channel, mode: OutputCompareMode) { |
| 93 | let r = Self::$regs(); | ||
| 94 | let raw_channel: usize = channel.index(); | 93 | let raw_channel: usize = channel.index(); |
| 95 | r.ccmr_output(raw_channel / 2) | 94 | Self::$regs() |
| 95 | .ccmr_output(raw_channel / 2) | ||
| 96 | .modify(|w| w.set_ocm(raw_channel % 2, mode.into())); | 96 | .modify(|w| w.set_ocm(raw_channel % 2, mode.into())); |
| 97 | } | 97 | } |
| 98 | 98 | ||
| @@ -133,7 +133,7 @@ pub(crate) mod sealed { | |||
| 133 | /// Set output compare preload. | 133 | /// Set output compare preload. |
| 134 | fn set_output_compare_preload(&mut self, channel: Channel, preload: bool) { | 134 | fn set_output_compare_preload(&mut self, channel: Channel, preload: bool) { |
| 135 | let channel_index = channel.index(); | 135 | let channel_index = channel.index(); |
| 136 | Self::regs_1ch() | 136 | Self::$regs() |
| 137 | .ccmr_output(channel_index / 2) | 137 | .ccmr_output(channel_index / 2) |
| 138 | .modify(|w| w.set_ocpe(channel_index % 2, preload)); | 138 | .modify(|w| w.set_ocpe(channel_index % 2, preload)); |
| 139 | } | 139 | } |
