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)]
|
#[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,
|
||||||
}
|
}
|
||||||
|
@ -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 {
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user