fix warnings

This commit is contained in:
Ulf Lilleengen 2024-01-25 08:38:28 +01:00
parent 1989c229f9
commit 3739cc0699
5 changed files with 8 additions and 3 deletions

View File

@ -2,7 +2,6 @@ pub use nrf51_pac as pac;
/// The maximum buffer size that the EasyDMA can send/recv in one operation. /// The maximum buffer size that the EasyDMA can send/recv in one operation.
pub const EASY_DMA_SIZE: usize = (1 << 14) - 1; pub const EASY_DMA_SIZE: usize = (1 << 14) - 1;
pub const FORCE_COPY_BUFFER_SIZE: usize = 256;
pub const FLASH_SIZE: usize = 128 * 1024; pub const FLASH_SIZE: usize = 128 * 1024;

View File

@ -487,6 +487,7 @@ impl<'a, P: Pin> PselBits for Option<PeripheralRef<'a, P>> {
} }
} }
#[allow(dead_code)]
pub(crate) fn deconfigure_pin(psel_bits: u32) { pub(crate) fn deconfigure_pin(psel_bits: u32) {
if psel_bits & 0x8000_0000 != 0 { if psel_bits & 0x8000_0000 != 0 {
return; return;

View File

@ -336,6 +336,7 @@ mod consts {
pub const APPROTECT_DISABLED: u32 = 0x0000_005a; pub const APPROTECT_DISABLED: u32 = 0x0000_005a;
} }
#[cfg(not(feature = "nrf51"))]
#[derive(Debug, Copy, Clone, Eq, PartialEq)] #[derive(Debug, Copy, Clone, Eq, PartialEq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
enum WriteResult { enum WriteResult {
@ -347,10 +348,12 @@ enum WriteResult {
Failed, Failed,
} }
#[cfg(not(feature = "nrf51"))]
unsafe fn uicr_write(address: *mut u32, value: u32) -> WriteResult { unsafe fn uicr_write(address: *mut u32, value: u32) -> WriteResult {
uicr_write_masked(address, value, 0xFFFF_FFFF) uicr_write_masked(address, value, 0xFFFF_FFFF)
} }
#[cfg(not(feature = "nrf51"))]
unsafe fn uicr_write_masked(address: *mut u32, value: u32, mask: u32) -> WriteResult { unsafe fn uicr_write_masked(address: *mut u32, value: u32, mask: u32) -> WriteResult {
let curr_val = address.read_volatile(); let curr_val = address.read_volatile();
if curr_val & mask == value & mask { if curr_val & mask == value & mask {
@ -383,6 +386,7 @@ pub fn init(config: config::Config) -> Peripherals {
// before doing anything important. // before doing anything important.
let peripherals = Peripherals::take(); let peripherals = Peripherals::take();
#[allow(unused_mut)]
let mut needs_reset = false; let mut needs_reset = false;
// Setup debug protection. // Setup debug protection.

View File

@ -111,7 +111,7 @@ impl<'d, T: Instance> Timer<'d, T> {
Self::new_inner(timer, true) Self::new_inner(timer, true)
} }
fn new_inner(timer: impl Peripheral<P = T> + 'd, is_counter: bool) -> Self { fn new_inner(timer: impl Peripheral<P = T> + 'd, _is_counter: bool) -> Self {
into_ref!(timer); into_ref!(timer);
let regs = T::regs(); let regs = T::regs();
@ -123,7 +123,7 @@ impl<'d, T: Instance> Timer<'d, T> {
this.stop(); this.stop();
#[cfg(not(feature = "nrf51"))] #[cfg(not(feature = "nrf51"))]
if is_counter { if _is_counter {
regs.mode.write(|w| w.mode().low_power_counter()); regs.mode.write(|w| w.mode().low_power_counter());
} else { } else {
regs.mode.write(|w| w.mode().timer()); regs.mode.write(|w| w.mode().timer());

View File

@ -1,3 +1,4 @@
#![allow(dead_code)]
use core::mem; use core::mem;
const SRAM_LOWER: usize = 0x2000_0000; const SRAM_LOWER: usize = 0x2000_0000;