summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDario Nieuwenhuis <dirbaio@dirbaio.net>2020-12-09 17:39:26 +0100
committerDario Nieuwenhuis <dirbaio@dirbaio.net>2020-12-09 17:39:26 +0100
commite53816e2d6a6fa21aba5c9dce031ca71764cb4f1 (patch)
tree77c80d57c02431024f763e673d6e3ca6bd1e529e /examples
parentb0e7227a6872eadab7cb27e08a4e0781869dd324 (diff)
downloadnrf-softdevice-e53816e2d6a6fa21aba5c9dce031ca71764cb4f1.zip
Add support for log and defmt based on feature flags.
Diffstat (limited to 'examples')
-rw-r--r--examples/Cargo.toml2
-rw-r--r--examples/src/bin/ble_l2cap_central.rs6
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/Cargo.toml b/examples/Cargo.toml
index a818bc9..4413169 100644
--- a/examples/Cargo.toml
+++ b/examples/Cargo.toml
@@ -32,7 +32,7 @@ defmt = "0.1.3"
nrf-softdevice-defmt-rtt = { path = "../nrf-softdevice-defmt-rtt", version = "0.1.0" }
panic-probe = "0.1.0"
nrf52840-hal = { version = "0.11.0" }
-nrf-softdevice = { version = "0.1.0", path = "../nrf-softdevice", features = ["defmt-trace", "nrf52840", "s140", "ble-peripheral", "ble-central"] }
+nrf-softdevice = { version = "0.1.0", path = "../nrf-softdevice", features = ["defmt", "defmt-trace", "nrf52840", "s140", "ble-peripheral", "ble-central"] }
nrf-softdevice-s140 = { version = "0.1.1", path = "../nrf-softdevice-s140" }
futures = { version = "0.3.5", default-features = false }
fixed = "1.2.0"
diff --git a/examples/src/bin/ble_l2cap_central.rs b/examples/src/bin/ble_l2cap_central.rs
index bb9d974..b329fa5 100644
--- a/examples/src/bin/ble_l2cap_central.rs
+++ b/examples/src/bin/ble_l2cap_central.rs
@@ -99,7 +99,7 @@ impl l2cap::Packet for Packet {
let mut v = Vec::with_capacity(Self::MTU);
let ptr = v.as_mut_ptr();
mem::forget(v);
- info!("allocate {:u32}", ptr as u32);
+ info!("allocate {:?}", ptr as u32);
NonNull::new(ptr)
}
@@ -107,12 +107,12 @@ impl l2cap::Packet for Packet {
let ptr = self.0.as_mut_ptr();
let len = self.0.len();
mem::forget(self);
- info!("into_raw_parts {:u32}", ptr as u32);
+ info!("into_raw_parts {:?}", ptr as u32);
(unwrap!(NonNull::new(ptr)), len)
}
unsafe fn from_raw_parts(ptr: NonNull<u8>, len: usize) -> Self {
- info!("from_raw_parts {:u32}", ptr.as_ptr() as u32);
+ info!("from_raw_parts {:?}", ptr.as_ptr() as u32);
Self(Vec::from_raw_parts(ptr.as_ptr(), len, Self::MTU))
}
}