Skip to content

Commit fe86d84

Browse files
committed
Enable more PWM pins
1 parent 46006b9 commit fe86d84

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

src/pwm.rs

+11-14
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::hal;
77
use crate::stm32::{TIM1, TIM15, TIM2};
88

99
use crate::gpio::gpioa::{PA0, PA1, PA10, PA11, PA15, PA2, PA3, PA8, PA9};
10-
use crate::gpio::gpiob::{PB10, PB11, PB14, PB3};
10+
use crate::gpio::gpiob::{PB10, PB11, PB14, PB15, PB3};
1111
use crate::gpio::Alternate;
1212
use crate::rcc::{Clocks, Enable, Reset, APB1R1, APB2};
1313
use crate::time::Hertz;
@@ -92,15 +92,14 @@ pins_to_channels_mapping! {
9292
TIM2: (PB10), (C3), (1);
9393
TIM2: (PB11), (C4), (1);
9494

95-
// TIM15 - TODO: The uncommented lines are awaiting PAC updates to be valid.
9695
TIM15: (PB14), (C1), (14);
97-
// TIM15: (PB15), (C2), (14);
96+
TIM15: (PB15), (C2), (14);
9897
TIM15: (PA2), (C1), (14);
99-
// TIM15: (PA3), (C2), (14);
100-
// TIM15: (PB14, PB15), (C1, C2), (14, 14);
101-
// TIM15: (PB14, PA3), (C1, C2), (14, 14);
102-
// TIM15: (PA2, PB15), (C1, C2), (14, 14);
103-
// TIM15: (PA2, PA3), (C1, C2), (14, 14);
98+
TIM15: (PA3), (C2), (14);
99+
TIM15: (PB14, PB15), (C1, C2), (14, 14);
100+
TIM15: (PB14, PA3), (C1, C2), (14, 14);
101+
TIM15: (PA2, PB15), (C1, C2), (14, 14);
102+
TIM15: (PA2, PA3), (C1, C2), (14, 14);
104103
}
105104

106105
pub trait PwmExt1: Sized {
@@ -316,10 +315,9 @@ macro_rules! small_timer {
316315
tim.ccmr1_output().modify(|_, w| w.oc1pe().set_bit().oc1m().bits(6));
317316
}
318317

319-
// TODO: The uncommented lines are awaiting PAC updates to be valid.
320-
// if PINS::C2 {
321-
// tim.ccmr1_output().modify(|_, w| w.oc2pe().set_bit().oc2m().bits(6));
322-
// }
318+
if PINS::C2 {
319+
tim.ccmr1_output().modify(|_, w| w.oc2pe().set_bit().oc2m().bits(6));
320+
}
323321

324322
let clk = clocks.pclk1();
325323
let ticks = clk / freq;
@@ -344,8 +342,7 @@ macro_rules! small_timer {
344342

345343
pwm_channels! {
346344
$TIMX: (C1, $arr_width, cc1e, ccr1, ccr),
347-
// TODO: The uncommented line is awaiting PAC updates to be valid.
348-
// (C2, $arr_width, cc2e, ccr2, ccr2),
345+
(C2, $arr_width, cc2e, ccr2, ccr2),
349346
}
350347

351348
)+

0 commit comments

Comments
 (0)