seperate start from pwmseq::new

This commit is contained in:
Jacob Rosenthal
2021-11-01 20:18:24 -07:00
parent 49253152cf
commit 4647792ad6
3 changed files with 28 additions and 15 deletions

View File

@ -26,12 +26,12 @@ async fn main(_spawner: Spawner, p: Peripherals) {
sequence_load: SequenceLoad::Individual,
refresh: 0,
end_delay: 0,
times: SequenceMode::Times(5),
};
let _pwm = unwrap!(PwmSeq::new(
let pwm = unwrap!(PwmSeq::new(
p.PWM0, p.P0_13, p.P0_15, p.P0_16, p.P0_14, config
));
unwrap!(pwm.start(SequenceMode::Times(5)));
info!("pwm started!");
loop {

View File

@ -30,10 +30,10 @@ async fn main(_spawner: Spawner, p: Peripherals) {
sequence_load: SequenceLoad::Common,
refresh: 0,
end_delay: 0,
times: SequenceMode::Infinite,
};
let pwm = unwrap!(PwmSeq::new(p.PWM0, p.P0_13, NoPin, NoPin, NoPin, config));
unwrap!(pwm.start(SequenceMode::Infinite));
info!("pwm started!");
Timer::after(Duration::from_millis(20000)).await;