diff options
author | alexmoon <alex.r.moon@gmail.com> | 2022-07-14 15:45:28 -0400 |
---|---|---|
committer | alexmoon <alex.r.moon@gmail.com> | 2022-07-14 15:45:28 -0400 |
commit | 98a31ce672c3113a2c238dc4e2ae9d632e59713a (patch) | |
tree | 36af82b9b26b04e2a7738515d50fc6b189d540b0 /examples/src/bin/ble_peripheral_onoff.rs | |
parent | 84006cd336adf2642cb5716433abb5540c4fb8b9 (diff) | |
download | nrf-softdevice-98a31ce672c3113a2c238dc4e2ae9d632e59713a.zip |
Add rustfmt.toml to match embassy formatting
Diffstat (limited to 'examples/src/bin/ble_peripheral_onoff.rs')
-rw-r--r-- | examples/src/bin/ble_peripheral_onoff.rs | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/examples/src/bin/ble_peripheral_onoff.rs b/examples/src/bin/ble_peripheral_onoff.rs index 101f208..a75ec49 100644 --- a/examples/src/bin/ble_peripheral_onoff.rs +++ b/examples/src/bin/ble_peripheral_onoff.rs @@ -6,6 +6,7 @@ mod example_common; use core::mem; + use cortex_m_rt::entry; use defmt::*; use embassy::executor::Executor; @@ -13,7 +14,6 @@ use embassy::util::Forever; use embassy_nrf::gpio::{AnyPin, Input, Pin as _, Pull}; use embassy_nrf::interrupt::Priority; use futures::pin_mut; - use nrf_softdevice::ble::{gatt_server, peripheral}; use nrf_softdevice::{raw, Softdevice}; @@ -49,10 +49,7 @@ async fn run_bluetooth(sd: &'static Softdevice, server: &Server) { loop { let config = peripheral::Config::default(); - let adv = peripheral::ConnectableAdvertisement::ScannableUndirected { - adv_data, - scan_data, - }; + let adv = peripheral::ConnectableAdvertisement::ScannableUndirected { adv_data, scan_data }; let conn = unwrap!(peripheral::advertise_connectable(sd, adv, &config).await); info!("advertising done!"); @@ -141,9 +138,7 @@ fn main() -> ! { event_length: 24, }), conn_gatt: Some(raw::ble_gatt_conn_cfg_t { att_mtu: 256 }), - gatts_attr_tab_size: Some(raw::ble_gatts_cfg_attr_tab_size_t { - attr_tab_size: 32768, - }), + gatts_attr_tab_size: Some(raw::ble_gatts_cfg_attr_tab_size_t { attr_tab_size: 32768 }), gap_role_count: Some(raw::ble_gap_cfg_role_count_t { adv_set_count: 1, periph_role_count: 3, @@ -156,9 +151,7 @@ fn main() -> ! { current_len: 9, max_len: 9, write_perm: unsafe { mem::zeroed() }, - _bitfield_1: raw::ble_gap_cfg_device_name_t::new_bitfield_1( - raw::BLE_GATTS_VLOC_STACK as u8, - ), + _bitfield_1: raw::ble_gap_cfg_device_name_t::new_bitfield_1(raw::BLE_GATTS_VLOC_STACK as u8), }), ..Default::default() }; @@ -169,11 +162,6 @@ fn main() -> ! { executor.run(move |spawner| { let server = unwrap!(Server::new(sd)); unwrap!(spawner.spawn(softdevice_task(sd))); - unwrap!(spawner.spawn(bluetooth_task( - sd, - server, - p.P0_11.degrade(), - p.P0_12.degrade() - ))); + unwrap!(spawner.spawn(bluetooth_task(sd, server, p.P0_11.degrade(), p.P0_12.degrade()))); }); } |