rename error enum again
This commit is contained in:
parent
4647792ad6
commit
c939edb8d0
@ -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,
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user