From a1a0d87a14c047c8b2838ec2f8c62a5ca8875406 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Fri, 26 Feb 2021 01:08:04 +0100 Subject: Fix warnings. Closes #39 --- examples/src/bin/ble_bas_central.rs | 6 +++--- examples/src/bin/ble_bas_peripheral.rs | 12 ++++++------ examples/src/bin/ble_l2cap_central.rs | 7 +++---- examples/src/bin/ble_l2cap_peripheral.rs | 10 ++++------ examples/src/bin/ble_peripheral_onoff.rs | 4 ++-- examples/src/bin/ble_scan.rs | 6 +++--- examples/src/bin/flash.rs | 4 ++-- examples/src/bin/interrupts.rs | 6 +++--- examples/src/bin/rtic.rs | 6 +++--- 9 files changed, 29 insertions(+), 32 deletions(-) (limited to 'examples/src/bin') diff --git a/examples/src/bin/ble_bas_central.rs b/examples/src/bin/ble_bas_central.rs index d601cb8..9ee9a0b 100644 --- a/examples/src/bin/ble_bas_central.rs +++ b/examples/src/bin/ble_bas_central.rs @@ -10,11 +10,11 @@ use example_common::*; use core::mem; use cortex_m_rt::entry; use defmt::info; -use defmt::{panic, *}; +use defmt::*; use embassy::executor::{task, Executor}; use embassy::util::Forever; -use nrf_softdevice::ble::{central, gatt_client, Address, AddressType, Connection, Uuid}; +use nrf_softdevice::ble::{central, gatt_client, Address, AddressType}; use nrf_softdevice::raw; use nrf_softdevice::Softdevice; @@ -95,7 +95,7 @@ fn main() -> ! { ..Default::default() }; - let (sdp, p) = take_peripherals(); + let (sdp, _p) = take_peripherals(); let sd = Softdevice::enable(sdp, &config); let executor = EXECUTOR.put(Executor::new()); diff --git a/examples/src/bin/ble_bas_peripheral.rs b/examples/src/bin/ble_bas_peripheral.rs index 89c4621..462dfc9 100644 --- a/examples/src/bin/ble_bas_peripheral.rs +++ b/examples/src/bin/ble_bas_peripheral.rs @@ -10,10 +10,10 @@ use example_common::*; use core::mem; use cortex_m_rt::entry; use defmt::info; -use defmt::{panic, *}; +use defmt::*; -use nrf_softdevice::ble::{gatt_server, peripheral, Connection}; -use nrf_softdevice::{raw, RawError, Softdevice}; +use nrf_softdevice::ble::{gatt_server, peripheral}; +use nrf_softdevice::{raw, Softdevice}; use embassy::executor::{task, Executor}; use embassy::util::Forever; @@ -33,7 +33,7 @@ struct BatteryService { } #[task] -async fn bluetooth_task(sd: &'static Softdevice, config: peripheral::Config) { +async fn bluetooth_task(sd: &'static Softdevice) { let server: BatteryService = unwrap!(gatt_server::register(sd)); #[rustfmt::skip] let adv_data = &[ @@ -125,12 +125,12 @@ fn main() -> ! { ..Default::default() }; - let (sdp, p) = take_peripherals(); + let (sdp, _p) = take_peripherals(); let sd = Softdevice::enable(sdp, &config); let executor = EXECUTOR.put(Executor::new()); executor.run(|spawner| { unwrap!(spawner.spawn(softdevice_task(sd))); - unwrap!(spawner.spawn(bluetooth_task(sd, peripheral::Config::default()))); + unwrap!(spawner.spawn(bluetooth_task(sd))); }); } diff --git a/examples/src/bin/ble_l2cap_central.rs b/examples/src/bin/ble_l2cap_central.rs index 9ac6a86..ff30164 100644 --- a/examples/src/bin/ble_l2cap_central.rs +++ b/examples/src/bin/ble_l2cap_central.rs @@ -13,13 +13,12 @@ use core::ptr::NonNull; use core::slice; use cortex_m_rt::entry; use defmt::info; -use defmt::{panic, *}; +use defmt::*; use embassy::executor::{task, Executor}; use embassy::util::Forever; -use heapless::consts::*; use nrf_softdevice::ble::l2cap::Packet as _; -use nrf_softdevice::ble::{central, l2cap, Address, Connection, TxPower, Uuid}; +use nrf_softdevice::ble::{central, l2cap, Address, TxPower}; use nrf_softdevice::raw; use nrf_softdevice::Softdevice; @@ -171,7 +170,7 @@ fn main() -> ! { ..Default::default() }; - let (sdp, p) = take_peripherals(); + let (sdp, _p) = take_peripherals(); let sd = Softdevice::enable(sdp, &config); let executor = EXECUTOR.put(Executor::new()); diff --git a/examples/src/bin/ble_l2cap_peripheral.rs b/examples/src/bin/ble_l2cap_peripheral.rs index 3418cc7..871cb01 100644 --- a/examples/src/bin/ble_l2cap_peripheral.rs +++ b/examples/src/bin/ble_l2cap_peripheral.rs @@ -11,11 +11,11 @@ use example_common::*; use core::mem; use core::ptr::NonNull; use cortex_m_rt::entry; -use defmt::{panic, *}; +use defmt::*; use nrf_softdevice::ble; -use nrf_softdevice::ble::{l2cap, peripheral, Connection}; -use nrf_softdevice::{raw, RawError, Softdevice}; +use nrf_softdevice::ble::{l2cap, peripheral}; +use nrf_softdevice::{raw, Softdevice}; use embassy::executor::{task, Executor}; use embassy::util::Forever; @@ -64,8 +64,6 @@ async fn bluetooth_task(sd: &'static Softdevice) { let pkt = unwrap!(ch.rx().await); info!("rx: {:x}", pkt.0); } - - futures::future::pending::<()>().await; } } @@ -147,7 +145,7 @@ fn main() -> ! { ..Default::default() }; - let (sdp, p) = take_peripherals(); + let (sdp, _p) = take_peripherals(); let sd = Softdevice::enable(sdp, &config); let executor = EXECUTOR.put(Executor::new()); diff --git a/examples/src/bin/ble_peripheral_onoff.rs b/examples/src/bin/ble_peripheral_onoff.rs index 83686f4..d516991 100644 --- a/examples/src/bin/ble_peripheral_onoff.rs +++ b/examples/src/bin/ble_peripheral_onoff.rs @@ -18,8 +18,8 @@ use embassy_nrf::interrupt; use futures::pin_mut; use nrf52840_hal::gpio; -use nrf_softdevice::ble::{gatt_server, peripheral, Connection}; -use nrf_softdevice::{pac, raw, RawError, Softdevice}; +use nrf_softdevice::ble::{gatt_server, peripheral}; +use nrf_softdevice::{pac, raw, Softdevice}; static EXECUTOR: Forever = Forever::new(); diff --git a/examples/src/bin/ble_scan.rs b/examples/src/bin/ble_scan.rs index 74e2d62..d49574d 100644 --- a/examples/src/bin/ble_scan.rs +++ b/examples/src/bin/ble_scan.rs @@ -10,11 +10,11 @@ use example_common::*; use core::mem; use core::slice; use cortex_m_rt::entry; -use defmt::{panic, *}; +use defmt::*; use embassy::executor::{task, Executor}; use embassy::util::Forever; -use nrf_softdevice::ble::{central, TxPower}; +use nrf_softdevice::ble::central; use nrf_softdevice::raw; use nrf_softdevice::Softdevice; @@ -106,7 +106,7 @@ fn main() -> ! { ..Default::default() }; - let (sdp, p) = take_peripherals(); + let (sdp, _p) = take_peripherals(); let sd = Softdevice::enable(sdp, &config); let executor = EXECUTOR.put(Executor::new()); diff --git a/examples/src/bin/flash.rs b/examples/src/bin/flash.rs index 1d765c7..84a71ab 100644 --- a/examples/src/bin/flash.rs +++ b/examples/src/bin/flash.rs @@ -8,7 +8,7 @@ mod example_common; use example_common::*; use cortex_m_rt::entry; -use defmt::{panic, *}; +use defmt::*; use embassy::executor::{task, Executor}; use embassy::flash::Flash as _; use embassy::util::Forever; @@ -39,7 +39,7 @@ async fn flash_task(sd: &'static Softdevice) { fn main() -> ! { info!("Hello World!"); - let (sdp, p) = take_peripherals(); + let (sdp, _p) = take_peripherals(); let sd = Softdevice::enable(sdp, &Default::default()); let executor = EXECUTOR.put(Executor::new()); diff --git a/examples/src/bin/interrupts.rs b/examples/src/bin/interrupts.rs index 55c896c..baeb3e8 100644 --- a/examples/src/bin/interrupts.rs +++ b/examples/src/bin/interrupts.rs @@ -8,7 +8,7 @@ mod example_common; use example_common::*; use cortex_m_rt::entry; -use defmt::{panic, *}; +use defmt::*; use embassy::executor::{task, Executor}; use embassy::util::Forever; @@ -23,7 +23,7 @@ async fn softdevice_task(sd: &'static Softdevice) { } #[task] -async fn interrupt_task(sd: &'static Softdevice) { +async fn interrupt_task(_sd: &'static Softdevice) { let enabled = interrupt::is_enabled(interrupt::SWI0_EGU0); info!("enabled: {:?}", enabled); @@ -89,7 +89,7 @@ fn SWI1_EGU1() { fn main() -> ! { info!("Hello World!"); - let (sdp, p) = take_peripherals(); + let (sdp, _p) = take_peripherals(); let sd = Softdevice::enable(sdp, &Default::default()); let executor = EXECUTOR.put(Executor::new()); diff --git a/examples/src/bin/rtic.rs b/examples/src/bin/rtic.rs index 7fd34b5..cf7be99 100644 --- a/examples/src/bin/rtic.rs +++ b/examples/src/bin/rtic.rs @@ -19,7 +19,7 @@ mod example_common; use example_common::*; use core::mem; -use defmt::{panic, *}; +use defmt::*; use embassy::executor::{task, Executor}; use embassy::util::Forever; use nrf52840_hal::pac::TIMER1; @@ -56,7 +56,7 @@ async fn bluetooth_task(sd: &'static Softdevice) { adv_data, scan_data, }; - let conn = unwrap!(peripheral::advertise(sd, adv, &config).await); + let _conn = unwrap!(peripheral::advertise(sd, adv, &config).await); info!("advertising done!"); } @@ -116,7 +116,7 @@ const APP: () = { ..Default::default() }; - let (sdp, p) = take_peripherals(); + let (sdp, _p) = take_peripherals(); // Softdevice enable must not be done in RTIC init // because RTIC runs init with interrupts disabled, and the -- cgit v1.2.3