common/peripheral: do not require mut in PeripheralRef clone_unchecked.
This commit is contained in:
@ -342,7 +342,7 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarte<'d, U, T> {
|
||||
r.enable.write(|w| w.enable().enabled());
|
||||
|
||||
// Configure byte counter.
|
||||
let mut timer = Timer::new_counter(timer);
|
||||
let timer = Timer::new_counter(timer);
|
||||
timer.cc(1).write(rx_buffer.len() as u32 * 2);
|
||||
timer.cc(1).short_compare_clear();
|
||||
timer.clear();
|
||||
|
@ -315,7 +315,7 @@ impl<'d, const N: usize> Saadc<'d, N> {
|
||||
Ppi::new_one_to_one(ppi_ch1, Event::from_reg(&r.events_end), Task::from_reg(&r.tasks_start));
|
||||
start_ppi.enable();
|
||||
|
||||
let mut timer = Timer::new(timer);
|
||||
let timer = Timer::new(timer);
|
||||
timer.set_frequency(frequency);
|
||||
timer.cc(0).write(sample_counter);
|
||||
timer.cc(0).short_compare_clear();
|
||||
|
@ -117,7 +117,7 @@ impl<'d, T: Instance> Timer<'d, T> {
|
||||
|
||||
let regs = T::regs();
|
||||
|
||||
let mut this = Self { _p: timer };
|
||||
let this = Self { _p: timer };
|
||||
|
||||
// Stop the timer before doing anything else,
|
||||
// since changing BITMODE while running can cause 'unpredictable behaviour' according to the specification.
|
||||
|
@ -205,7 +205,7 @@ impl<'d, T: Instance> Uarte<'d, T> {
|
||||
ppi_ch1: impl Peripheral<P = impl ConfigurableChannel + 'd> + 'd,
|
||||
ppi_ch2: impl Peripheral<P = impl ConfigurableChannel + 'd> + 'd,
|
||||
) -> (UarteTx<'d, T>, UarteRxWithIdle<'d, T, U>) {
|
||||
let mut timer = Timer::new(timer);
|
||||
let timer = Timer::new(timer);
|
||||
|
||||
into_ref!(ppi_ch1, ppi_ch2);
|
||||
|
||||
|
@ -153,7 +153,7 @@ impl<'d, T: Instance, V: VbusDetect + 'd> driver::Driver<'d> for Driver<'d, T, V
|
||||
}))
|
||||
}
|
||||
|
||||
fn start(mut self, control_max_packet_size: u16) -> (Self::Bus, Self::ControlPipe) {
|
||||
fn start(self, control_max_packet_size: u16) -> (Self::Bus, Self::ControlPipe) {
|
||||
(
|
||||
Bus {
|
||||
_p: unsafe { self._p.clone_unchecked() },
|
||||
|
Reference in New Issue
Block a user