Permit many sequences to be passed
Sequences are now passed in via the start method to avoid having to stop the PWM and restart it. Sequences continue to be constrained with the same lifetime of the Pwm object itself. The pwm_sequence example has been extended to illustrate multiple sequences being passed around.
This commit is contained in:
@ -27,16 +27,10 @@ async fn main(_spawner: Spawner, p: Peripherals) {
|
||||
config.refresh = 30;
|
||||
|
||||
let pwm = unwrap!(SequencePwm::new(
|
||||
p.PWM0,
|
||||
p.P0_13,
|
||||
NoPin,
|
||||
NoPin,
|
||||
NoPin,
|
||||
config,
|
||||
&seq_values
|
||||
p.PWM0, p.P0_13, NoPin, NoPin, NoPin, config,
|
||||
));
|
||||
|
||||
let _ = pwm.start(SequenceMode::Times(1));
|
||||
let _ = pwm.start(&seq_values, SequenceMode::Times(1));
|
||||
// pwm.stop() deconfigures pins, and then the task_start_seq0 task cant work
|
||||
// so its going to have to start running in order load the configuration
|
||||
|
||||
|
Reference in New Issue
Block a user