From a18b3b3926032eed1061280a1e9349d9c2fec3ed Mon Sep 17 00:00:00 2001 From: Alex Moon Date: Fri, 9 Aug 2024 21:56:42 -0400 Subject: [PATCH] Update deps Also fix warnings generated by newer versions of rustc. --- examples/Cargo.toml | 6 ++-- examples/build.rs | 9 ------ nrf-softdevice-macro/src/security_mode.rs | 1 - nrf-softdevice/Cargo.toml | 2 +- nrf-softdevice/src/ble/central.rs | 4 +-- nrf-softdevice/src/ble/gatt_server/builder.rs | 29 ------------------- .../src/ble/gatt_server/characteristic.rs | 5 ---- nrf-softdevice/src/fmt.rs | 1 + 8 files changed, 7 insertions(+), 50 deletions(-) diff --git a/examples/Cargo.toml b/examples/Cargo.toml index f99a634b..491ad1ec 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -31,10 +31,10 @@ nrf52840 = [ ] [dependencies] -embassy-executor = { version = "0.5.0", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"]} +embassy-executor = { version = "0.6.0", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"]} embassy-time = { version = "0.3.0", features = ["defmt", "defmt-timestamp-uptime"]} -embassy-sync = { version = "0.5.0" } -embassy-nrf = { version = "0.1.0", features = ["defmt", "gpiote", "time-driver-rtc1" ]} +embassy-sync = { version = "0.6.0" } +embassy-nrf = { version = "0.2.0", features = ["defmt", "gpiote", "time-driver-rtc1" ]} cortex-m = "0.7.7" cortex-m-rt = "0.7.3" defmt = "0.3.5" diff --git a/examples/build.rs b/examples/build.rs index 2f848556..c1afc708 100644 --- a/examples/build.rs +++ b/examples/build.rs @@ -18,15 +18,6 @@ fn linker_data() -> &'static [u8] { return include_bytes!("memory-nrf52832.x"); #[cfg(feature = "nrf52840")] return include_bytes!("memory-nrf52840.x"); - - #[cfg(any( - feature = "nrf52805", - feature = "nrf52810", - feature = "nrf52811", - feature = "nrf52820", - feature = "nrf52833", - ))] - panic!("Unable to build examples for currently selected chip due to missing chip-specific linker configuration (memory.x)"); } fn main() { diff --git a/nrf-softdevice-macro/src/security_mode.rs b/nrf-softdevice-macro/src/security_mode.rs index af18664e..46372c01 100644 --- a/nrf-softdevice-macro/src/security_mode.rs +++ b/nrf-softdevice-macro/src/security_mode.rs @@ -3,7 +3,6 @@ use proc_macro2::TokenStream; use quote::{quote, ToTokens}; #[derive(Debug, PartialEq, Eq, Clone, Copy)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum SecurityMode { NoAccess, Open, diff --git a/nrf-softdevice/Cargo.toml b/nrf-softdevice/Cargo.toml index 0c8b1918..c1359b9c 100644 --- a/nrf-softdevice/Cargo.toml +++ b/nrf-softdevice/Cargo.toml @@ -53,7 +53,7 @@ log = { version = "0.4.11", optional = true } critical-section = { version = "1.0", optional = true } num_enum = { version = "0.7.0", default-features = false } -embassy-sync = { version = "0.5.0" } +embassy-sync = { version = "0.6.0" } embassy-futures = { version = "0.1.1" } cortex-m = "0.7.2" cortex-m-rt = ">=0.6.15,<0.8" diff --git a/nrf-softdevice/src/ble/central.rs b/nrf-softdevice/src/ble/central.rs index 1d4adf15..0418aeb9 100644 --- a/nrf-softdevice/src/ble/central.rs +++ b/nrf-softdevice/src/ble/central.rs @@ -187,7 +187,7 @@ where len: BUF_LEN as u16, }; - let ret = unsafe { raw::sd_ble_gap_scan_start(&scan_params, &BUF_DATA) }; + let ret = unsafe { raw::sd_ble_gap_scan_start(&scan_params, ptr::addr_of!(BUF_DATA)) }; match RawError::convert(ret) { Ok(()) => {} Err(err) => { @@ -218,7 +218,7 @@ where } // Resume scan - let ret = raw::sd_ble_gap_scan_start(ptr::null(), &BUF_DATA); + let ret = raw::sd_ble_gap_scan_start(ptr::null(), ptr::addr_of!(BUF_DATA)); match RawError::convert(ret) { Ok(()) => {} diff --git a/nrf-softdevice/src/ble/gatt_server/builder.rs b/nrf-softdevice/src/ble/gatt_server/builder.rs index 14e7e91f..77f91efc 100644 --- a/nrf-softdevice/src/ble/gatt_server/builder.rs +++ b/nrf-softdevice/src/ble/gatt_server/builder.rs @@ -4,12 +4,6 @@ use core::marker::PhantomData; use core::mem; use core::ptr::null; -#[cfg(feature = "alloc")] -extern crate alloc; - -#[cfg(feature = "alloc")] -use alloc::boxed::Box; - use super::characteristic::{self, AttributeMetadata, Presentation}; use super::{CharacteristicHandles, DescriptorHandle, IncludedServiceHandle, RegisterError, ServiceHandle}; use crate::ble::Uuid; @@ -54,18 +48,6 @@ impl<'a> ServiceBuilder<'a> { self.add_characteristic_inner(uuid, value, attr.max_len, &attr_md, md) } - #[cfg(feature = "alloc")] - pub fn add_characteristic_app( - &mut self, - uuid: Uuid, - attr: characteristic::Attribute>, - md: characteristic::Metadata, - ) -> Result, RegisterError> { - let value = Box::leak(attr.value); - let attr_md = attr.metadata.into_raw_user(); - self.add_characteristic_inner(uuid, value, attr.max_len, &attr_md, md) - } - fn add_characteristic_inner( &mut self, uuid: Uuid, @@ -152,17 +134,6 @@ impl<'a> CharacteristicBuilder<'a> { self.add_descriptor_inner(uuid, value, attr.max_len, &attr_md) } - #[cfg(feature = "alloc")] - pub fn add_descriptor_app( - &mut self, - uuid: Uuid, - attr: characteristic::Attribute>, - ) -> Result { - let value = Box::leak(attr.value); - let attr_md = attr.metadata.into_raw_user(); - self.add_descriptor_inner(uuid, value, attr.max_len, &attr_md) - } - fn add_descriptor_inner( &mut self, uuid: Uuid, diff --git a/nrf-softdevice/src/ble/gatt_server/characteristic.rs b/nrf-softdevice/src/ble/gatt_server/characteristic.rs index 832da402..5aa5dea7 100644 --- a/nrf-softdevice/src/ble/gatt_server/characteristic.rs +++ b/nrf-softdevice/src/ble/gatt_server/characteristic.rs @@ -37,11 +37,6 @@ impl AttributeMetadata { self.into_raw_inner(raw::BLE_GATTS_VLOC_STACK as u8) } - #[cfg(feature = "alloc")] - pub(crate) fn into_raw_user(self) -> raw::ble_gatts_attr_md_t { - self.into_raw_inner(raw::BLE_GATTS_VLOC_USER as u8) - } - fn into_raw_inner(self, vloc: u8) -> raw::ble_gatts_attr_md_t { raw::ble_gatts_attr_md_t { read_perm: self.read.into_raw(), diff --git a/nrf-softdevice/src/fmt.rs b/nrf-softdevice/src/fmt.rs index 06697081..3b8e8d52 100644 --- a/nrf-softdevice/src/fmt.rs +++ b/nrf-softdevice/src/fmt.rs @@ -201,6 +201,7 @@ pub struct NoneError; pub trait Try { type Ok; type Error; + #[allow(dead_code)] fn into_result(self) -> Result; }