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)]
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,
}

View File

@ -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 {

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));
unwrap!(pwm.start(SequenceMode::Infinite));
let _ = pwm.start(SequenceMode::Infinite);
info!("pwm started!");
Timer::after(Duration::from_millis(20000)).await;