aboutsummaryrefslogtreecommitdiff
path: root/examples/nrf/src/bin/pwm_sequence_ppi.rs
diff options
context:
space:
mode:
authorhuntc <[email protected]>2022-02-05 08:05:23 +1100
committerhuntc <[email protected]>2022-02-05 08:05:23 +1100
commitdf5ba727f2c8bd3f2a67f51a3f43d7f47b011b1c (patch)
treedbc3853104a92609140a8ab8a350b621b9faf1d7 /examples/nrf/src/bin/pwm_sequence_ppi.rs
parent81d31e43ebf947ff2cd91b3a6f6af092fcb7e2b7 (diff)
Further API simplification for the single seq scenario
Diffstat (limited to 'examples/nrf/src/bin/pwm_sequence_ppi.rs')
-rw-r--r--examples/nrf/src/bin/pwm_sequence_ppi.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/nrf/src/bin/pwm_sequence_ppi.rs b/examples/nrf/src/bin/pwm_sequence_ppi.rs
index 7e58c37e6..c25c5e10d 100644
--- a/examples/nrf/src/bin/pwm_sequence_ppi.rs
+++ b/examples/nrf/src/bin/pwm_sequence_ppi.rs
@@ -12,7 +12,7 @@ use embassy_nrf::gpio::{Input, NoPin, Pull};
12use embassy_nrf::gpiote::{InputChannel, InputChannelPolarity}; 12use embassy_nrf::gpiote::{InputChannel, InputChannelPolarity};
13use embassy_nrf::ppi::Ppi; 13use embassy_nrf::ppi::Ppi;
14use embassy_nrf::pwm::{ 14use embassy_nrf::pwm::{
15 Config, Prescaler, Sequence, SequenceConfig, SequencePwm, SingleSequenceMode, SingleSequencer, 15 Config, Prescaler, SequenceConfig, SequencePwm, SingleSequenceMode, SingleSequencer,
16}; 16};
17use embassy_nrf::Peripherals; 17use embassy_nrf::Peripherals;
18 18
@@ -53,8 +53,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
53 let start = unsafe { pwm.task_start_seq0() }; 53 let start = unsafe { pwm.task_start_seq0() };
54 let stop = unsafe { pwm.task_stop() }; 54 let stop = unsafe { pwm.task_stop() };
55 55
56 let sequence = Sequence::new(&seq_words, seq_config); 56 let sequencer = SingleSequencer::new(&mut pwm, &seq_words, seq_config);
57 let sequencer = SingleSequencer::new(&mut pwm, sequence);
58 unwrap!(sequencer.start(SingleSequenceMode::Infinite)); 57 unwrap!(sequencer.start(SingleSequenceMode::Infinite));
59 58
60 let mut ppi = Ppi::new_one_to_one(p.PPI_CH1, button1.event_in(), start); 59 let mut ppi = Ppi::new_one_to_one(p.PPI_CH1, button1.event_in(), start);