diff --git a/embassy-nrf/src/pwm.rs b/embassy-nrf/src/pwm.rs index cffe5a3b..61a28283 100644 --- a/embassy-nrf/src/pwm.rs +++ b/embassy-nrf/src/pwm.rs @@ -138,7 +138,7 @@ impl<'d, T: Instance> SequencePwm<'d, T> { /// Start or restart playback #[inline(always)] - pub fn start(&self, sequence: &'d [u16], times: SequenceMode) -> Result<(), Error> { + pub fn start(&mut self, sequence: &'d [u16], times: SequenceMode) -> Result<(), Error> { slice_in_ram_or(sequence, Error::DMABufferNotInDataMemory)?; if sequence.len() > 32767 { diff --git a/examples/nrf/src/bin/pwm_sequence.rs b/examples/nrf/src/bin/pwm_sequence.rs index 9877b54a..561bc1dd 100644 --- a/examples/nrf/src/bin/pwm_sequence.rs +++ b/examples/nrf/src/bin/pwm_sequence.rs @@ -25,7 +25,7 @@ async fn main(_spawner: Spawner, p: Peripherals) { config.refresh = 624; // thus our sequence takes 5 * 5000ms or 25 seconds - let pwm = unwrap!(SequencePwm::new( + let mut pwm = unwrap!(SequencePwm::new( p.PWM0, p.P0_13, NoPin, NoPin, NoPin, config, )); let _ = pwm.start(&seq_values_1, SequenceMode::Infinite); diff --git a/examples/nrf/src/bin/pwm_sequence_ppi.rs b/examples/nrf/src/bin/pwm_sequence_ppi.rs index f72ccc11..213ef5ed 100644 --- a/examples/nrf/src/bin/pwm_sequence_ppi.rs +++ b/examples/nrf/src/bin/pwm_sequence_ppi.rs @@ -26,7 +26,7 @@ async fn main(_spawner: Spawner, p: Peripherals) { // thus our sequence takes 5 * 250ms or 1.25 seconds config.refresh = 30; - let pwm = unwrap!(SequencePwm::new( + let mut pwm = unwrap!(SequencePwm::new( p.PWM0, p.P0_13, NoPin, NoPin, NoPin, config, ));