From c939edb8d03a6ddf965507e3b2de02b82ca255b4 Mon Sep 17 00:00:00 2001 From: Jacob Rosenthal Date: Tue, 2 Nov 2021 10:57:01 -0700 Subject: [PATCH] rename error enum again --- embassy-nrf/src/pwm.rs | 4 ++-- examples/nrf/src/bin/pwm_sequence.rs | 2 +- examples/nrf/src/bin/pwm_simple_sin.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/embassy-nrf/src/pwm.rs b/embassy-nrf/src/pwm.rs index 9454ad4a..6468f267 100644 --- a/embassy-nrf/src/pwm.rs +++ b/embassy-nrf/src/pwm.rs @@ -161,7 +161,7 @@ impl<'d, T: Instance> PwmSeq<'d, T> { #[inline(always)] pub fn start(&self, times: SequenceMode) -> Result<(), Error> { if let SequenceMode::Times(0) = times { - return Err(Error::SequenceNoZero); + return Err(Error::SequenceTimesAtLeastOne); } let r = T::regs(); @@ -272,7 +272,7 @@ pub enum Error { /// Max Sequence size is 32767 SequenceTooLong, /// Min Sequence size is 1 - SequenceNoZero, + SequenceTimesAtLeastOne, /// EasyDMA can only read from data memory, read only buffers in flash will fail. DMABufferNotInDataMemory, } diff --git a/examples/nrf/src/bin/pwm_sequence.rs b/examples/nrf/src/bin/pwm_sequence.rs index 6911d034..8830e52d 100644 --- a/examples/nrf/src/bin/pwm_sequence.rs +++ b/examples/nrf/src/bin/pwm_sequence.rs @@ -31,7 +31,7 @@ async fn main(_spawner: Spawner, p: Peripherals) { 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))); + let _ = pwm.start(SequenceMode::Times(5)); info!("pwm started!"); loop { diff --git a/examples/nrf/src/bin/pwm_simple_sin.rs b/examples/nrf/src/bin/pwm_simple_sin.rs index 985f9d80..ac3089c8 100644 --- a/examples/nrf/src/bin/pwm_simple_sin.rs +++ b/examples/nrf/src/bin/pwm_simple_sin.rs @@ -33,7 +33,7 @@ async fn main(_spawner: Spawner, p: Peripherals) { }; let pwm = unwrap!(PwmSeq::new(p.PWM0, p.P0_13, NoPin, NoPin, NoPin, config)); - unwrap!(pwm.start(SequenceMode::Infinite)); + let _ = pwm.start(SequenceMode::Infinite); info!("pwm started!"); Timer::after(Duration::from_millis(20000)).await;