diff options
| author | Jacob Rosenthal <[email protected]> | 2021-11-02 10:57:01 -0700 |
|---|---|---|
| committer | Jacob Rosenthal <[email protected]> | 2021-11-02 10:57:01 -0700 |
| commit | c939edb8d03a6ddf965507e3b2de02b82ca255b4 (patch) | |
| tree | e51f77f37e748bc2bfb3b488c21ad8f125f6df60 | |
| parent | 4647792ad68209f3be6e1cdf1cee9513025c14ab (diff) | |
rename error enum again
| -rw-r--r-- | embassy-nrf/src/pwm.rs | 4 | ||||
| -rw-r--r-- | examples/nrf/src/bin/pwm_sequence.rs | 2 | ||||
| -rw-r--r-- | 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 9454ad4a8..6468f2674 100644 --- a/embassy-nrf/src/pwm.rs +++ b/embassy-nrf/src/pwm.rs | |||
| @@ -161,7 +161,7 @@ impl<'d, T: Instance> PwmSeq<'d, T> { | |||
| 161 | #[inline(always)] | 161 | #[inline(always)] |
| 162 | pub fn start(&self, times: SequenceMode) -> Result<(), Error> { | 162 | pub fn start(&self, times: SequenceMode) -> Result<(), Error> { |
| 163 | if let SequenceMode::Times(0) = times { | 163 | if let SequenceMode::Times(0) = times { |
| 164 | return Err(Error::SequenceNoZero); | 164 | return Err(Error::SequenceTimesAtLeastOne); |
| 165 | } | 165 | } |
| 166 | let r = T::regs(); | 166 | let r = T::regs(); |
| 167 | 167 | ||
| @@ -272,7 +272,7 @@ pub enum Error { | |||
| 272 | /// Max Sequence size is 32767 | 272 | /// Max Sequence size is 32767 |
| 273 | SequenceTooLong, | 273 | SequenceTooLong, |
| 274 | /// Min Sequence size is 1 | 274 | /// Min Sequence size is 1 |
| 275 | SequenceNoZero, | 275 | SequenceTimesAtLeastOne, |
| 276 | /// EasyDMA can only read from data memory, read only buffers in flash will fail. | 276 | /// EasyDMA can only read from data memory, read only buffers in flash will fail. |
| 277 | DMABufferNotInDataMemory, | 277 | DMABufferNotInDataMemory, |
| 278 | } | 278 | } |
diff --git a/examples/nrf/src/bin/pwm_sequence.rs b/examples/nrf/src/bin/pwm_sequence.rs index 6911d0348..8830e52d6 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) { | |||
| 31 | let pwm = unwrap!(PwmSeq::new( | 31 | let pwm = unwrap!(PwmSeq::new( |
| 32 | 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 |
| 33 | )); | 33 | )); |
| 34 | unwrap!(pwm.start(SequenceMode::Times(5))); | 34 | let _ = 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 985f9d80a..ac3089c84 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) { | |||
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | 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)); | 36 | let _ = 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; |
