From b3cdf3a040ae97923e84eca525505f7eff55e870 Mon Sep 17 00:00:00 2001 From: eZio Pan Date: Fri, 2 Feb 2024 14:52:54 +0800 Subject: [PATCH] bug fix --- embassy-stm32/src/timer/mod.rs | 6 +++--- 1 file 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 { /// Set output compare mode. fn set_output_compare_mode(&mut self, channel: Channel, mode: OutputCompareMode) { - let r = Self::$regs(); let raw_channel: usize = channel.index(); - r.ccmr_output(raw_channel / 2) + Self::$regs() + .ccmr_output(raw_channel / 2) .modify(|w| w.set_ocm(raw_channel % 2, mode.into())); } @@ -133,7 +133,7 @@ pub(crate) mod sealed { /// Set output compare preload. fn set_output_compare_preload(&mut self, channel: Channel, preload: bool) { let channel_index = channel.index(); - Self::regs_1ch() + Self::$regs() .ccmr_output(channel_index / 2) .modify(|w| w.set_ocpe(channel_index % 2, preload)); }