rename error enum again

This commit is contained in:
Jacob Rosenthal 2021-11-02 10:57:01 -07:00
parent 4647792ad6
commit c939edb8d0
3 changed files with 4 additions and 4 deletions

View File

@ -161,7 +161,7 @@ impl<'d, T: Instance> PwmSeq<'d, T> {
#[inline(always)] #[inline(always)]
pub fn start(&self, times: SequenceMode) -> Result<(), Error> { pub fn start(&self, times: SequenceMode) -> Result<(), Error> {
if let SequenceMode::Times(0) = times { if let SequenceMode::Times(0) = times {
return Err(Error::SequenceNoZero); return Err(Error::SequenceTimesAtLeastOne);
} }
let r = T::regs(); let r = T::regs();
@ -272,7 +272,7 @@ pub enum Error {
/// Max Sequence size is 32767 /// Max Sequence size is 32767
SequenceTooLong, SequenceTooLong,
/// Min Sequence size is 1 /// Min Sequence size is 1
SequenceNoZero, SequenceTimesAtLeastOne,
/// EasyDMA can only read from data memory, read only buffers in flash will fail. /// EasyDMA can only read from data memory, read only buffers in flash will fail.
DMABufferNotInDataMemory, DMABufferNotInDataMemory,
} }

View File

@ -31,7 +31,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
let pwm = unwrap!(PwmSeq::new( let pwm = unwrap!(PwmSeq::new(
p.PWM0, p.P0_13, p.P0_15, p.P0_16, p.P0_14, config 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!"); info!("pwm started!");
loop { loop {

View File

@ -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)); 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!"); info!("pwm started!");
Timer::after(Duration::from_millis(20000)).await; Timer::after(Duration::from_millis(20000)).await;