From 03dd50316c6f41a2bfab62289aa22abdaaa3189d Mon Sep 17 00:00:00 2001 From: Liu Hancheng Date: Sat, 4 Jan 2025 21:38:22 +0800 Subject: [PATCH] refactor: simplify timer bits handling --- embassy-stm32/src/timer/simple_pwm.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/embassy-stm32/src/timer/simple_pwm.rs b/embassy-stm32/src/timer/simple_pwm.rs index 8d3c9a131..757536c2d 100644 --- a/embassy-stm32/src/timer/simple_pwm.rs +++ b/embassy-stm32/src/timer/simple_pwm.rs @@ -414,8 +414,10 @@ macro_rules! impl_waveform_chx { ) .await } - #[cfg(not(any(stm32l0, bdma, gpdma)))] + #[cfg(not(any(stm32l0)))] TimerBits::Bits32 => { + #[cfg(any(bdma, gpdma))] + panic("unsupported timer bits"); Transfer::new_write( &mut dma, req, @@ -425,10 +427,6 @@ macro_rules! impl_waveform_chx { ) .await } - #[cfg(any(stm32l0, bdma, gpdma))] - _ => { - panic!("unsupported timer bits") - } }; };