make both news configure registers in same order

This commit is contained in:
Jacob Rosenthal 2021-11-03 18:15:42 -07:00
parent 44375b427c
commit 82695c8f65

View File

@ -118,17 +118,6 @@ impl<'d, T: Instance> PwmSeq<'d, T> {
// Enable // Enable
r.enable.write(|w| w.enable().enabled()); r.enable.write(|w| w.enable().enabled());
r.mode
.write(|w| unsafe { w.bits(config.counter_mode as u32) });
r.prescaler
.write(|w| w.prescaler().bits(config.prescaler as u8));
r.countertop
.write(|w| unsafe { w.countertop().bits(config.top) });
r.decoder.write(|w| {
w.load().bits(config.sequence_load as u8);
w.mode().refresh_count()
});
r.seq0 r.seq0
.ptr .ptr
@ -152,6 +141,18 @@ impl<'d, T: Instance> PwmSeq<'d, T> {
.enddelay .enddelay
.write(|w| unsafe { w.bits(config.end_delay) }); .write(|w| unsafe { w.bits(config.end_delay) });
r.decoder.write(|w| {
w.load().bits(config.sequence_load as u8);
w.mode().refresh_count()
});
r.mode
.write(|w| unsafe { w.bits(config.counter_mode as u32) });
r.prescaler
.write(|w| w.prescaler().bits(config.prescaler as u8));
r.countertop
.write(|w| unsafe { w.countertop().bits(config.top) });
Ok(Self { Ok(Self {
phantom: PhantomData, phantom: PhantomData,
}) })