Skip to content

Commit 3eaeaa6

Browse files
committed
implement PWM for TIM2 on supported devices
1 parent b782375 commit 3eaeaa6

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/pwm.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,26 @@ macro_rules! pwm_1_channel_with_complementary_outputs {
874874

875875
use crate::pac::*;
876876

877-
pwm_4_channels!(TIM3: (tim3, tim3en, tim3rst, apb1enr, apb1rstr),);
877+
pwm_4_channels!(
878+
TIM3: (tim3, tim3en, tim3rst, apb1enr, apb1rstr),
879+
);
880+
881+
#[cfg(any(
882+
feature = "stm32f031",
883+
feature = "stm32f038",
884+
feature = "stm32f042",
885+
feature = "stm32f048",
886+
feature = "stm32f051",
887+
feature = "stm32f058",
888+
feature = "stm32f071",
889+
feature = "stm32f072",
890+
feature = "stm32f078",
891+
feature = "stm32f091",
892+
feature = "stm32f098",
893+
))]
894+
pwm_4_channels!(
895+
TIM2: (tim2, tim2en, tim2rst, apb1enr, apb1rstr),
896+
);
878897

879898
pwm_4_channels_with_3_complementary_outputs!(TIM1: (tim1, tim1en, tim1rst, apb2enr, apb2rstr),);
880899
pwm_1_channel!(TIM14: (tim14, tim14en, tim14rst, apb1enr, apb1rstr),);

0 commit comments

Comments
 (0)