Skip to content

Commit c1d044a

Browse files
committed
fix example
1 parent 5e864e8 commit c1d044a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/pwm.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ fn main() -> ! {
4848
// let c3 = gpiob.pb8.into_alternate_push_pull(&mut gpiob.crh);
4949
// let c4 = gpiob.pb9.into_alternate_push_pull(&mut gpiob.crh);
5050

51-
let mut pwm = Timer::tim2(p.TIM2, &clocks, &mut rcc.apb1)
51+
let (_, _, mut pwm) = Timer::tim2(p.TIM2, &clocks, &mut rcc.apb1)
5252
.pwm::<Tim2NoRemap, _, _, _>(pins, &mut afio.mapr, 1.khz())
53-
.2;
53+
.split();
5454

5555
let max = pwm.get_max_duty();
5656

src/pwm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ where
236236
REMAP: Remap<Periph = TIM>,
237237
PINS: Pins<REMAP, P>
238238
{
239-
pub fn split() -> PINS::Channels {
239+
pub fn split(self) -> PINS::Channels {
240240
unsafe { mem::MaybeUninit::uninit().assume_init() }
241241
}
242242
}

0 commit comments

Comments
 (0)