diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-04-11 23:00:14 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2023-04-11 23:09:02 +0200 |
| commit | 9a677ab618aa7a7612cd079b77d3240bdb02fdac (patch) | |
| tree | 17eacc9698a823a8ad5af3fd44468f54e69a5c1d /embassy-nrf | |
| parent | 5c42ca13bd207c5923cb36e1454f3f838582b6cb (diff) | |
common/peripheral: do not require mut in PeripheralRef clone_unchecked.
Diffstat (limited to 'embassy-nrf')
| -rw-r--r-- | embassy-nrf/src/buffered_uarte.rs | 2 | ||||
| -rw-r--r-- | embassy-nrf/src/saadc.rs | 2 | ||||
| -rw-r--r-- | embassy-nrf/src/timer.rs | 2 | ||||
| -rw-r--r-- | embassy-nrf/src/uarte.rs | 2 | ||||
| -rw-r--r-- | embassy-nrf/src/usb/mod.rs | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/embassy-nrf/src/buffered_uarte.rs b/embassy-nrf/src/buffered_uarte.rs index 75f93f904..c41d8398c 100644 --- a/embassy-nrf/src/buffered_uarte.rs +++ b/embassy-nrf/src/buffered_uarte.rs | |||
| @@ -342,7 +342,7 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarte<'d, U, T> { | |||
| 342 | r.enable.write(|w| w.enable().enabled()); | 342 | r.enable.write(|w| w.enable().enabled()); |
| 343 | 343 | ||
| 344 | // Configure byte counter. | 344 | // Configure byte counter. |
| 345 | let mut timer = Timer::new_counter(timer); | 345 | let timer = Timer::new_counter(timer); |
| 346 | timer.cc(1).write(rx_buffer.len() as u32 * 2); | 346 | timer.cc(1).write(rx_buffer.len() as u32 * 2); |
| 347 | timer.cc(1).short_compare_clear(); | 347 | timer.cc(1).short_compare_clear(); |
| 348 | timer.clear(); | 348 | timer.clear(); |
diff --git a/embassy-nrf/src/saadc.rs b/embassy-nrf/src/saadc.rs index af952f03d..8aff7df16 100644 --- a/embassy-nrf/src/saadc.rs +++ b/embassy-nrf/src/saadc.rs | |||
| @@ -315,7 +315,7 @@ impl<'d, const N: usize> Saadc<'d, N> { | |||
| 315 | Ppi::new_one_to_one(ppi_ch1, Event::from_reg(&r.events_end), Task::from_reg(&r.tasks_start)); | 315 | Ppi::new_one_to_one(ppi_ch1, Event::from_reg(&r.events_end), Task::from_reg(&r.tasks_start)); |
| 316 | start_ppi.enable(); | 316 | start_ppi.enable(); |
| 317 | 317 | ||
| 318 | let mut timer = Timer::new(timer); | 318 | let timer = Timer::new(timer); |
| 319 | timer.set_frequency(frequency); | 319 | timer.set_frequency(frequency); |
| 320 | timer.cc(0).write(sample_counter); | 320 | timer.cc(0).write(sample_counter); |
| 321 | timer.cc(0).short_compare_clear(); | 321 | timer.cc(0).short_compare_clear(); |
diff --git a/embassy-nrf/src/timer.rs b/embassy-nrf/src/timer.rs index a9487a9fd..48b4f1b55 100644 --- a/embassy-nrf/src/timer.rs +++ b/embassy-nrf/src/timer.rs | |||
| @@ -117,7 +117,7 @@ impl<'d, T: Instance> Timer<'d, T> { | |||
| 117 | 117 | ||
| 118 | let regs = T::regs(); | 118 | let regs = T::regs(); |
| 119 | 119 | ||
| 120 | let mut this = Self { _p: timer }; | 120 | let this = Self { _p: timer }; |
| 121 | 121 | ||
| 122 | // Stop the timer before doing anything else, | 122 | // Stop the timer before doing anything else, |
| 123 | // since changing BITMODE while running can cause 'unpredictable behaviour' according to the specification. | 123 | // since changing BITMODE while running can cause 'unpredictable behaviour' according to the specification. |
diff --git a/embassy-nrf/src/uarte.rs b/embassy-nrf/src/uarte.rs index 3934d1b55..e59b2332a 100644 --- a/embassy-nrf/src/uarte.rs +++ b/embassy-nrf/src/uarte.rs | |||
| @@ -205,7 +205,7 @@ impl<'d, T: Instance> Uarte<'d, T> { | |||
| 205 | ppi_ch1: impl Peripheral<P = impl ConfigurableChannel + 'd> + 'd, | 205 | ppi_ch1: impl Peripheral<P = impl ConfigurableChannel + 'd> + 'd, |
| 206 | ppi_ch2: impl Peripheral<P = impl ConfigurableChannel + 'd> + 'd, | 206 | ppi_ch2: impl Peripheral<P = impl ConfigurableChannel + 'd> + 'd, |
| 207 | ) -> (UarteTx<'d, T>, UarteRxWithIdle<'d, T, U>) { | 207 | ) -> (UarteTx<'d, T>, UarteRxWithIdle<'d, T, U>) { |
| 208 | let mut timer = Timer::new(timer); | 208 | let timer = Timer::new(timer); |
| 209 | 209 | ||
| 210 | into_ref!(ppi_ch1, ppi_ch2); | 210 | into_ref!(ppi_ch1, ppi_ch2); |
| 211 | 211 | ||
diff --git a/embassy-nrf/src/usb/mod.rs b/embassy-nrf/src/usb/mod.rs index 56de511df..c1f3f48cb 100644 --- a/embassy-nrf/src/usb/mod.rs +++ b/embassy-nrf/src/usb/mod.rs | |||
| @@ -153,7 +153,7 @@ impl<'d, T: Instance, V: VbusDetect + 'd> driver::Driver<'d> for Driver<'d, T, V | |||
| 153 | })) | 153 | })) |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | fn start(mut self, control_max_packet_size: u16) -> (Self::Bus, Self::ControlPipe) { | 156 | fn start(self, control_max_packet_size: u16) -> (Self::Bus, Self::ControlPipe) { |
| 157 | ( | 157 | ( |
| 158 | Bus { | 158 | Bus { |
| 159 | _p: unsafe { self._p.clone_unchecked() }, | 159 | _p: unsafe { self._p.clone_unchecked() }, |
