Skip to content

Commit bb1600b

Browse files
authored
Merge pull request #286 from NZRosto/macros-feature
Add macros feature
2 parents 93ad991 + 9678ea6 commit bb1600b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

nrf-softdevice/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ keywords = ["arm", "cortex-m", "nrf52", "nrf-softdevice"]
1111
rust-version = "1.76"
1212

1313
[features]
14+
default = ["macros"]
1415

1516
nrf52805 = []
1617
nrf52810 = []
@@ -39,6 +40,8 @@ critical-section-impl = ["critical-section/restore-state-bool"]
3940

4041
usable-from-interrupts = []
4142

43+
macros = ["dep:nrf-softdevice-macro"]
44+
4245
# Workaround l2cap credit bug. If set, infinite credits are issued
4346
# to the peer in batches. The `credits` config when establishing the channel is ignored.
4447
# https://devzone.nordicsemi.com/f/nordic-q-a/81894/s140-7-3-0-softdevice-assertion-failed-at-pc-0xa806-using-l2cap
@@ -68,7 +71,7 @@ nrf-softdevice-s122 = { version = "0.1.1", path = "../nrf-softdevice-s122", opti
6871
nrf-softdevice-s132 = { version = "0.1.1", path = "../nrf-softdevice-s132", optional = true }
6972
nrf-softdevice-s140 = { version = "0.1.1", path = "../nrf-softdevice-s140", optional = true }
7073

71-
nrf-softdevice-macro = { version = "0.1.0", path = "../nrf-softdevice-macro" }
74+
nrf-softdevice-macro = { version = "0.1.0", path = "../nrf-softdevice-macro", optional = true }
7275

7376
[package.metadata.docs.rs]
7477
targets = ["thumbv7em-none-eabi"]

nrf-softdevice/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ mod temperature;
153153
pub use temperature::temperature_celsius;
154154

155155
mod random;
156+
#[cfg(feature = "macros")]
156157
pub use nrf_softdevice_macro::*;
157158
pub use random::random_bytes;
158159

0 commit comments

Comments
 (0)