aboutsummaryrefslogtreecommitdiff
path: root/embassy-rp
diff options
context:
space:
mode:
authorRafael Bachmann <[email protected]>2024-03-25 14:43:18 +0100
committerGitHub <[email protected]>2024-03-25 14:43:18 +0100
commitcf789be420f73a04f40b47500c916bbd8cd4740e (patch)
treed81e1de25e398140f6243d484d339a622eed76d1 /embassy-rp
parent255ed29853eb88bff2ee548c63fb4d0a6dfad7e8 (diff)
parent133a753e49a9e04ae4711a4cf8888df864aac98b (diff)
Merge branch 'embassy-rs:main' into barafael/minor_clippy_lints_rp
Diffstat (limited to 'embassy-rp')
-rw-r--r--embassy-rp/src/dma.rs2
-rw-r--r--embassy-rp/src/flash.rs2
-rw-r--r--embassy-rp/src/float/mod.rs1
-rw-r--r--embassy-rp/src/fmt.rs3
-rw-r--r--embassy-rp/src/gpio.rs2
-rw-r--r--embassy-rp/src/lib.rs3
-rw-r--r--embassy-rp/src/relocate.rs2
-rw-r--r--embassy-rp/src/uart/buffered.rs10
-rw-r--r--embassy-rp/src/usb.rs11
9 files changed, 7 insertions, 29 deletions
diff --git a/embassy-rp/src/dma.rs b/embassy-rp/src/dma.rs
index 088a842a1..44aabce6b 100644
--- a/embassy-rp/src/dma.rs
+++ b/embassy-rp/src/dma.rs
@@ -96,7 +96,7 @@ pub unsafe fn write_repeated<'a, C: Channel, W: Word>(
96) -> Transfer<'a, C> { 96) -> Transfer<'a, C> {
97 copy_inner( 97 copy_inner(
98 ch, 98 ch,
99 &mut DUMMY as *const u32, 99 core::ptr::addr_of_mut!(DUMMY) as *const u32,
100 to as *mut u32, 100 to as *mut u32,
101 len, 101 len,
102 W::size(), 102 W::size(),
diff --git a/embassy-rp/src/flash.rs b/embassy-rp/src/flash.rs
index 8bac93684..422b77400 100644
--- a/embassy-rp/src/flash.rs
+++ b/embassy-rp/src/flash.rs
@@ -420,8 +420,6 @@ impl<'d, T: Instance, const FLASH_SIZE: usize> embedded_storage_async::nor_flash
420 420
421#[allow(dead_code)] 421#[allow(dead_code)]
422mod ram_helpers { 422mod ram_helpers {
423 use core::marker::PhantomData;
424
425 use super::*; 423 use super::*;
426 use crate::rom_data; 424 use crate::rom_data;
427 425
diff --git a/embassy-rp/src/float/mod.rs b/embassy-rp/src/float/mod.rs
index 945afff90..3ad6f1c50 100644
--- a/embassy-rp/src/float/mod.rs
+++ b/embassy-rp/src/float/mod.rs
@@ -89,6 +89,7 @@ pub(crate) trait Float:
89 } 89 }
90 90
91 /// Returns true if `self` is infinity 91 /// Returns true if `self` is infinity
92 #[allow(unused)]
92 fn is_infinity(self) -> bool { 93 fn is_infinity(self) -> bool {
93 (self.repr() & (Self::EXPONENT_MASK | Self::SIGNIFICAND_MASK)) == Self::EXPONENT_MASK 94 (self.repr() & (Self::EXPONENT_MASK | Self::SIGNIFICAND_MASK)) == Self::EXPONENT_MASK
94 } 95 }
diff --git a/embassy-rp/src/fmt.rs b/embassy-rp/src/fmt.rs
index 78e583c1c..2ac42c557 100644
--- a/embassy-rp/src/fmt.rs
+++ b/embassy-rp/src/fmt.rs
@@ -1,5 +1,5 @@
1#![macro_use] 1#![macro_use]
2#![allow(unused_macros)] 2#![allow(unused)]
3 3
4use core::fmt::{Debug, Display, LowerHex}; 4use core::fmt::{Debug, Display, LowerHex};
5 5
@@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
229 } 229 }
230} 230}
231 231
232#[allow(unused)]
233pub(crate) struct Bytes<'a>(pub &'a [u8]); 232pub(crate) struct Bytes<'a>(pub &'a [u8]);
234 233
235impl<'a> Debug for Bytes<'a> { 234impl<'a> Debug for Bytes<'a> {
diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs
index 405bddfd8..a84c00a2c 100644
--- a/embassy-rp/src/gpio.rs
+++ b/embassy-rp/src/gpio.rs
@@ -976,8 +976,6 @@ impl_pin!(PIN_QSPI_SD3, Bank::Qspi, 5);
976// ==================== 976// ====================
977 977
978mod eh02 { 978mod eh02 {
979 use core::convert::Infallible;
980
981 use super::*; 979 use super::*;
982 980
983 impl<'d> embedded_hal_02::digital::v2::InputPin for Input<'d> { 981 impl<'d> embedded_hal_02::digital::v2::InputPin for Input<'d> {
diff --git a/embassy-rp/src/lib.rs b/embassy-rp/src/lib.rs
index 7092b3fab..d91cea410 100644
--- a/embassy-rp/src/lib.rs
+++ b/embassy-rp/src/lib.rs
@@ -274,7 +274,7 @@ pub fn install_core0_stack_guard() -> Result<(), ()> {
274 extern "C" { 274 extern "C" {
275 static mut _stack_end: usize; 275 static mut _stack_end: usize;
276 } 276 }
277 unsafe { install_stack_guard(&mut _stack_end as *mut usize) } 277 unsafe { install_stack_guard(core::ptr::addr_of_mut!(_stack_end)) }
278} 278}
279 279
280#[inline(always)] 280#[inline(always)]
@@ -354,6 +354,7 @@ pub fn init(config: config::Config) -> Peripherals {
354 354
355/// Extension trait for PAC regs, adding atomic xor/bitset/bitclear writes. 355/// Extension trait for PAC regs, adding atomic xor/bitset/bitclear writes.
356trait RegExt<T: Copy> { 356trait RegExt<T: Copy> {
357 #[allow(unused)]
357 fn write_xor<R>(&self, f: impl FnOnce(&mut T) -> R) -> R; 358 fn write_xor<R>(&self, f: impl FnOnce(&mut T) -> R) -> R;
358 fn write_set<R>(&self, f: impl FnOnce(&mut T) -> R) -> R; 359 fn write_set<R>(&self, f: impl FnOnce(&mut T) -> R) -> R;
359 fn write_clear<R>(&self, f: impl FnOnce(&mut T) -> R) -> R; 360 fn write_clear<R>(&self, f: impl FnOnce(&mut T) -> R) -> R;
diff --git a/embassy-rp/src/relocate.rs b/embassy-rp/src/relocate.rs
index 40cb2667b..34487819f 100644
--- a/embassy-rp/src/relocate.rs
+++ b/embassy-rp/src/relocate.rs
@@ -1,5 +1,3 @@
1use core::iter::Iterator;
2
3use pio::{Program, SideSet, Wrap}; 1use pio::{Program, SideSet, Wrap};
4 2
5pub struct CodeIterator<'a, I> 3pub struct CodeIterator<'a, I>
diff --git a/embassy-rp/src/uart/buffered.rs b/embassy-rp/src/uart/buffered.rs
index 7622539f1..da1157984 100644
--- a/embassy-rp/src/uart/buffered.rs
+++ b/embassy-rp/src/uart/buffered.rs
@@ -1,17 +1,11 @@
1//! Buffered UART driver. 1//! Buffered UART driver.
2use core::future::{poll_fn, Future}; 2use core::future::Future;
3use core::slice; 3use core::slice;
4use core::task::Poll;
5 4
6use atomic_polyfill::{AtomicU8, Ordering}; 5use atomic_polyfill::AtomicU8;
7use embassy_hal_internal::atomic_ring_buffer::RingBuffer; 6use embassy_hal_internal::atomic_ring_buffer::RingBuffer;
8use embassy_sync::waitqueue::AtomicWaker;
9use embassy_time::Timer;
10 7
11use super::*; 8use super::*;
12use crate::clocks::clk_peri_freq;
13use crate::interrupt::typelevel::{Binding, Interrupt};
14use crate::{interrupt, RegExt};
15 9
16pub struct State { 10pub struct State {
17 tx_waker: AtomicWaker, 11 tx_waker: AtomicWaker,
diff --git a/embassy-rp/src/usb.rs b/embassy-rp/src/usb.rs
index 905661d64..d68dee4a3 100644
--- a/embassy-rp/src/usb.rs
+++ b/embassy-rp/src/usb.rs
@@ -465,7 +465,6 @@ impl<'d, T: Instance> driver::Bus for Bus<'d, T> {
465 465
466trait Dir { 466trait Dir {
467 fn dir() -> Direction; 467 fn dir() -> Direction;
468 fn waker(i: usize) -> &'static AtomicWaker;
469} 468}
470 469
471/// Type for In direction. 470/// Type for In direction.
@@ -474,11 +473,6 @@ impl Dir for In {
474 fn dir() -> Direction { 473 fn dir() -> Direction {
475 Direction::In 474 Direction::In
476 } 475 }
477
478 #[inline]
479 fn waker(i: usize) -> &'static AtomicWaker {
480 &EP_IN_WAKERS[i]
481 }
482} 476}
483 477
484/// Type for Out direction. 478/// Type for Out direction.
@@ -487,11 +481,6 @@ impl Dir for Out {
487 fn dir() -> Direction { 481 fn dir() -> Direction {
488 Direction::Out 482 Direction::Out
489 } 483 }
490
491 #[inline]
492 fn waker(i: usize) -> &'static AtomicWaker {
493 &EP_OUT_WAKERS[i]
494 }
495} 484}
496 485
497/// Endpoint for RP USB driver. 486/// Endpoint for RP USB driver.