diff options
| author | Ulf Lilleengen <[email protected]> | 2024-01-25 08:38:28 +0100 |
|---|---|---|
| committer | Ulf Lilleengen <[email protected]> | 2024-01-25 08:38:28 +0100 |
| commit | 3739cc069914861d891a21734b3da9418bd01e9f (patch) | |
| tree | 5939a1d2016080045bac85ddc307978549d52d6e | |
| parent | 1989c229f99b1177133af51d514ba44a5b02fe6f (diff) | |
fix warnings
| -rw-r--r-- | embassy-nrf/src/chips/nrf51.rs | 1 | ||||
| -rw-r--r-- | embassy-nrf/src/gpio.rs | 1 | ||||
| -rw-r--r-- | embassy-nrf/src/lib.rs | 4 | ||||
| -rw-r--r-- | embassy-nrf/src/timer.rs | 4 | ||||
| -rw-r--r-- | embassy-nrf/src/util.rs | 1 |
5 files changed, 8 insertions, 3 deletions
diff --git a/embassy-nrf/src/chips/nrf51.rs b/embassy-nrf/src/chips/nrf51.rs index e7147ac93..016352fb8 100644 --- a/embassy-nrf/src/chips/nrf51.rs +++ b/embassy-nrf/src/chips/nrf51.rs | |||
| @@ -2,7 +2,6 @@ pub use nrf51_pac as pac; | |||
| 2 | 2 | ||
| 3 | /// The maximum buffer size that the EasyDMA can send/recv in one operation. | 3 | /// The maximum buffer size that the EasyDMA can send/recv in one operation. |
| 4 | pub const EASY_DMA_SIZE: usize = (1 << 14) - 1; | 4 | pub const EASY_DMA_SIZE: usize = (1 << 14) - 1; |
| 5 | pub const FORCE_COPY_BUFFER_SIZE: usize = 256; | ||
| 6 | 5 | ||
| 7 | pub const FLASH_SIZE: usize = 128 * 1024; | 6 | pub const FLASH_SIZE: usize = 128 * 1024; |
| 8 | 7 | ||
diff --git a/embassy-nrf/src/gpio.rs b/embassy-nrf/src/gpio.rs index b1eb8ae87..b2f987109 100644 --- a/embassy-nrf/src/gpio.rs +++ b/embassy-nrf/src/gpio.rs | |||
| @@ -487,6 +487,7 @@ impl<'a, P: Pin> PselBits for Option<PeripheralRef<'a, P>> { | |||
| 487 | } | 487 | } |
| 488 | } | 488 | } |
| 489 | 489 | ||
| 490 | #[allow(dead_code)] | ||
| 490 | pub(crate) fn deconfigure_pin(psel_bits: u32) { | 491 | pub(crate) fn deconfigure_pin(psel_bits: u32) { |
| 491 | if psel_bits & 0x8000_0000 != 0 { | 492 | if psel_bits & 0x8000_0000 != 0 { |
| 492 | return; | 493 | return; |
diff --git a/embassy-nrf/src/lib.rs b/embassy-nrf/src/lib.rs index 923e48ec2..358a7cc27 100644 --- a/embassy-nrf/src/lib.rs +++ b/embassy-nrf/src/lib.rs | |||
| @@ -336,6 +336,7 @@ mod consts { | |||
| 336 | pub const APPROTECT_DISABLED: u32 = 0x0000_005a; | 336 | pub const APPROTECT_DISABLED: u32 = 0x0000_005a; |
| 337 | } | 337 | } |
| 338 | 338 | ||
| 339 | #[cfg(not(feature = "nrf51"))] | ||
| 339 | #[derive(Debug, Copy, Clone, Eq, PartialEq)] | 340 | #[derive(Debug, Copy, Clone, Eq, PartialEq)] |
| 340 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 341 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 341 | enum WriteResult { | 342 | enum WriteResult { |
| @@ -347,10 +348,12 @@ enum WriteResult { | |||
| 347 | Failed, | 348 | Failed, |
| 348 | } | 349 | } |
| 349 | 350 | ||
| 351 | #[cfg(not(feature = "nrf51"))] | ||
| 350 | unsafe fn uicr_write(address: *mut u32, value: u32) -> WriteResult { | 352 | unsafe fn uicr_write(address: *mut u32, value: u32) -> WriteResult { |
| 351 | uicr_write_masked(address, value, 0xFFFF_FFFF) | 353 | uicr_write_masked(address, value, 0xFFFF_FFFF) |
| 352 | } | 354 | } |
| 353 | 355 | ||
| 356 | #[cfg(not(feature = "nrf51"))] | ||
| 354 | unsafe fn uicr_write_masked(address: *mut u32, value: u32, mask: u32) -> WriteResult { | 357 | unsafe fn uicr_write_masked(address: *mut u32, value: u32, mask: u32) -> WriteResult { |
| 355 | let curr_val = address.read_volatile(); | 358 | let curr_val = address.read_volatile(); |
| 356 | if curr_val & mask == value & mask { | 359 | if curr_val & mask == value & mask { |
| @@ -383,6 +386,7 @@ pub fn init(config: config::Config) -> Peripherals { | |||
| 383 | // before doing anything important. | 386 | // before doing anything important. |
| 384 | let peripherals = Peripherals::take(); | 387 | let peripherals = Peripherals::take(); |
| 385 | 388 | ||
| 389 | #[allow(unused_mut)] | ||
| 386 | let mut needs_reset = false; | 390 | let mut needs_reset = false; |
| 387 | 391 | ||
| 388 | // Setup debug protection. | 392 | // Setup debug protection. |
diff --git a/embassy-nrf/src/timer.rs b/embassy-nrf/src/timer.rs index 272fffc0a..3c35baee5 100644 --- a/embassy-nrf/src/timer.rs +++ b/embassy-nrf/src/timer.rs | |||
| @@ -111,7 +111,7 @@ impl<'d, T: Instance> Timer<'d, T> { | |||
| 111 | Self::new_inner(timer, true) | 111 | Self::new_inner(timer, true) |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | fn new_inner(timer: impl Peripheral<P = T> + 'd, is_counter: bool) -> Self { | 114 | fn new_inner(timer: impl Peripheral<P = T> + 'd, _is_counter: bool) -> Self { |
| 115 | into_ref!(timer); | 115 | into_ref!(timer); |
| 116 | 116 | ||
| 117 | let regs = T::regs(); | 117 | let regs = T::regs(); |
| @@ -123,7 +123,7 @@ impl<'d, T: Instance> Timer<'d, T> { | |||
| 123 | this.stop(); | 123 | this.stop(); |
| 124 | 124 | ||
| 125 | #[cfg(not(feature = "nrf51"))] | 125 | #[cfg(not(feature = "nrf51"))] |
| 126 | if is_counter { | 126 | if _is_counter { |
| 127 | regs.mode.write(|w| w.mode().low_power_counter()); | 127 | regs.mode.write(|w| w.mode().low_power_counter()); |
| 128 | } else { | 128 | } else { |
| 129 | regs.mode.write(|w| w.mode().timer()); | 129 | regs.mode.write(|w| w.mode().timer()); |
diff --git a/embassy-nrf/src/util.rs b/embassy-nrf/src/util.rs index cd0f59490..b408c517b 100644 --- a/embassy-nrf/src/util.rs +++ b/embassy-nrf/src/util.rs | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | #![allow(dead_code)] | ||
| 1 | use core::mem; | 2 | use core::mem; |
| 2 | 3 | ||
| 3 | const SRAM_LOWER: usize = 0x2000_0000; | 4 | const SRAM_LOWER: usize = 0x2000_0000; |
