Skip to content

Commit a93c347

Browse files
author
Jonas Schievink
committed
Fix warnings
1 parent 565b43c commit a93c347

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

src/adc.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,22 +1039,22 @@ where
10391039

10401040
// Set the channel in the right sequence field
10411041
match sequence {
1042-
config::Sequence::One => self.reg.sqr1.modify(|_, w| unsafe { w.sq1().bits(channel.into()) }),
1043-
config::Sequence::Two => self.reg.sqr1.modify(|_, w| unsafe { w.sq2().bits(channel.into()) }),
1044-
config::Sequence::Three => self.reg.sqr1.modify(|_, w| unsafe { w.sq3().bits(channel.into()) }),
1045-
config::Sequence::Four => self.reg.sqr1.modify(|_, w| unsafe { w.sq4().bits(channel.into()) }),
1046-
config::Sequence::Five => self.reg.sqr2.modify(|_, w| unsafe { w.sq5().bits(channel.into()) }),
1047-
config::Sequence::Six => self.reg.sqr2.modify(|_, w| unsafe { w.sq6().bits(channel.into()) }),
1048-
config::Sequence::Seven => self.reg.sqr2.modify(|_, w| unsafe { w.sq7().bits(channel.into()) }),
1049-
config::Sequence::Eight => self.reg.sqr2.modify(|_, w| unsafe { w.sq8().bits(channel.into()) }),
1050-
config::Sequence::Nine => self.reg.sqr2.modify(|_, w| unsafe { w.sq9().bits(channel.into()) }),
1051-
config::Sequence::Ten => self.reg.sqr3.modify(|_, w| unsafe { w.sq10().bits(channel.into()) }),
1052-
config::Sequence::Eleven => self.reg.sqr3.modify(|_, w| unsafe { w.sq11().bits(channel.into()) }),
1053-
config::Sequence::Twelve => self.reg.sqr3.modify(|_, w| unsafe { w.sq12().bits(channel.into()) }),
1054-
config::Sequence::Thirteen => self.reg.sqr3.modify(|_, w| unsafe { w.sq13().bits(channel.into()) }),
1055-
config::Sequence::Fourteen => self.reg.sqr3.modify(|_, w| unsafe { w.sq14().bits(channel.into()) }),
1056-
config::Sequence::Fifteen => self.reg.sqr4.modify(|_, w| unsafe { w.sq15().bits(channel.into()) }),
1057-
config::Sequence::Sixteen => self.reg.sqr4.modify(|_, w| unsafe { w.sq16().bits(channel.into()) }),
1042+
config::Sequence::One => self.reg.sqr1.modify(|_, w| w.sq1().bits(channel.into())),
1043+
config::Sequence::Two => self.reg.sqr1.modify(|_, w| w.sq2().bits(channel.into())),
1044+
config::Sequence::Three => self.reg.sqr1.modify(|_, w| w.sq3().bits(channel.into())),
1045+
config::Sequence::Four => self.reg.sqr1.modify(|_, w| w.sq4().bits(channel.into())),
1046+
config::Sequence::Five => self.reg.sqr2.modify(|_, w| w.sq5().bits(channel.into())),
1047+
config::Sequence::Six => self.reg.sqr2.modify(|_, w| w.sq6().bits(channel.into())),
1048+
config::Sequence::Seven => self.reg.sqr2.modify(|_, w| w.sq7().bits(channel.into())),
1049+
config::Sequence::Eight => self.reg.sqr2.modify(|_, w| w.sq8().bits(channel.into())),
1050+
config::Sequence::Nine => self.reg.sqr2.modify(|_, w| w.sq9().bits(channel.into())),
1051+
config::Sequence::Ten => self.reg.sqr3.modify(|_, w| w.sq10().bits(channel.into())),
1052+
config::Sequence::Eleven => self.reg.sqr3.modify(|_, w| w.sq11().bits(channel.into())),
1053+
config::Sequence::Twelve => self.reg.sqr3.modify(|_, w| w.sq12().bits(channel.into())),
1054+
config::Sequence::Thirteen => self.reg.sqr3.modify(|_, w| w.sq13().bits(channel.into())),
1055+
config::Sequence::Fourteen => self.reg.sqr3.modify(|_, w| w.sq14().bits(channel.into())),
1056+
config::Sequence::Fifteen => self.reg.sqr4.modify(|_, w| w.sq15().bits(channel.into())),
1057+
config::Sequence::Sixteen => self.reg.sqr4.modify(|_, w| w.sq16().bits(channel.into())),
10581058
}
10591059
}
10601060

src/timer.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,12 @@ impl defmt::Format for MonoTimer {
4545
impl MonoTimer {
4646
/// Creates a new `Monotonic` timer
4747
pub fn new(mut dwt: DWT, clocks: Clocks, dcb: &mut DCB) -> Self {
48+
// Takes ownership of `DWT` so that the CYCCNT counter can't be stopped or resetted.
49+
4850
// This is needed, so that the DWT timer starts to count.
4951
dcb.enable_trace();
5052
dwt.enable_cycle_counter();
5153

52-
// now the CYCCNT counter can't be stopped or resetted
53-
drop(dwt);
54-
5554
MonoTimer {
5655
frequency: clocks.hclk(),
5756
}

0 commit comments

Comments
 (0)