Skip to content

Commit cf0288f

Browse files
committed
Enable critical-section by default
The new svd2rust code needs `critical-section` for implementing the `Peripherals::take()` function. This means almost all uses of `avr-device` will need it as well. Rename the `critical-section-impl` feature to just `critical-section` and make it a part of the crate's default features.
1 parent f2605f4 commit cf0288f

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ avr64du32 = ["device-selected"]
8282
avr64du28 = ["device-selected"]
8383
rt = ["avr-device-macros"]
8484

85-
critical-section-impl = ["critical-section/restore-state-u8"]
85+
critical-section = ["critical-section/restore-state-u8"]
86+
87+
default = ["critical-section"]
8688

8789
# Unfortunately, we can only build documentation for a subset of the supported
8890
# MCUs on docs.rs. If you think a very popular chip is missing from the list,

examples/atmega328p/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ embedded-hal = "0.2.3"
2020
[dependencies.avr-device]
2121
version = "0.7"
2222
path = "../.."
23-
features = ["atmega328p", "rt", "critical-section-impl"]
23+
features = ["atmega328p", "rt"]
2424

2525
# Configure the build for minimal size - AVRs have very little program memory
2626
[profile.dev]

src/interrupt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ where
235235
}
236236
}
237237

238-
#[cfg(feature = "critical-section-impl")]
238+
#[cfg(feature = "critical-section")]
239239
mod cs {
240240
use critical_section::RawRestoreState;
241241

0 commit comments

Comments
 (0)