diff options
| author | Jacob Rosenthal <[email protected]> | 2021-11-01 20:18:24 -0700 |
|---|---|---|
| committer | Jacob Rosenthal <[email protected]> | 2021-11-01 20:50:18 -0700 |
| commit | 4647792ad68209f3be6e1cdf1cee9513025c14ab (patch) | |
| tree | cb22c6714eacfceb2511a23f6d19c26836c7ed22 /examples | |
| parent | 49253152cff2a45bd08cd1801bb6d5f0f3ce9b30 (diff) | |
seperate start from pwmseq::new
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/nrf/src/bin/pwm_sequence.rs | 4 | ||||
| -rw-r--r-- | examples/nrf/src/bin/pwm_simple_sin.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/nrf/src/bin/pwm_sequence.rs b/examples/nrf/src/bin/pwm_sequence.rs index 0a7bea1c4..6911d0348 100644 --- a/examples/nrf/src/bin/pwm_sequence.rs +++ b/examples/nrf/src/bin/pwm_sequence.rs | |||
| @@ -26,12 +26,12 @@ async fn main(_spawner: Spawner, p: Peripherals) { | |||
| 26 | sequence_load: SequenceLoad::Individual, | 26 | sequence_load: SequenceLoad::Individual, |
| 27 | refresh: 0, | 27 | refresh: 0, |
| 28 | end_delay: 0, | 28 | end_delay: 0, |
| 29 | times: SequenceMode::Times(5), | ||
| 30 | }; | 29 | }; |
| 31 | 30 | ||
| 32 | let _pwm = unwrap!(PwmSeq::new( | 31 | let pwm = unwrap!(PwmSeq::new( |
| 33 | p.PWM0, p.P0_13, p.P0_15, p.P0_16, p.P0_14, config | 32 | p.PWM0, p.P0_13, p.P0_15, p.P0_16, p.P0_14, config |
| 34 | )); | 33 | )); |
| 34 | unwrap!(pwm.start(SequenceMode::Times(5))); | ||
| 35 | info!("pwm started!"); | 35 | info!("pwm started!"); |
| 36 | 36 | ||
| 37 | loop { | 37 | loop { |
diff --git a/examples/nrf/src/bin/pwm_simple_sin.rs b/examples/nrf/src/bin/pwm_simple_sin.rs index 6fd59c6a4..985f9d80a 100644 --- a/examples/nrf/src/bin/pwm_simple_sin.rs +++ b/examples/nrf/src/bin/pwm_simple_sin.rs | |||
| @@ -30,10 +30,10 @@ async fn main(_spawner: Spawner, p: Peripherals) { | |||
| 30 | sequence_load: SequenceLoad::Common, | 30 | sequence_load: SequenceLoad::Common, |
| 31 | refresh: 0, | 31 | refresh: 0, |
| 32 | end_delay: 0, | 32 | end_delay: 0, |
| 33 | times: SequenceMode::Infinite, | ||
| 34 | }; | 33 | }; |
| 35 | 34 | ||
| 36 | let pwm = unwrap!(PwmSeq::new(p.PWM0, p.P0_13, NoPin, NoPin, NoPin, config)); | 35 | let pwm = unwrap!(PwmSeq::new(p.PWM0, p.P0_13, NoPin, NoPin, NoPin, config)); |
| 36 | unwrap!(pwm.start(SequenceMode::Infinite)); | ||
| 37 | info!("pwm started!"); | 37 | info!("pwm started!"); |
| 38 | 38 | ||
| 39 | Timer::after(Duration::from_millis(20000)).await; | 39 | Timer::after(Duration::from_millis(20000)).await; |
