Skip to content

Commit 3dff810

Browse files
committed
Remove features to rely on those generated by optional dependencies
1 parent 61f22f0 commit 3dff810

File tree

6 files changed

+22
-26
lines changed

6 files changed

+22
-26
lines changed

Diff for: .github/workflows/doctests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
include:
15-
- features: thumbv6
15+
- features: cortex-m
1616
nodefault: "--no-default-features"
1717
- features: ""
1818
nodefault: ""

Diff for: .github/workflows/embedded-builds.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
include:
1515
- features: ""
1616
target: thumbv7em-none-eabihf
17-
- feature: thumbv6
17+
- feature: cortex-m
1818
target: thumbv6m-none-eabi
1919

2020
steps:

Diff for: core/Cargo.toml

-4
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,5 @@ cortex-m = { version = "0.6.0", optional = true }
2121
version = "0.3.0"
2222
optional = true
2323

24-
[features]
25-
thumbv6 = ["cortex-m"]
26-
defmt_0_3 = ["defmt"]
27-
2824
[package.metadata.docs.rs]
2925
all-features = true

Diff for: core/src/bbbuffer.rs

+18-18
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<'a, const N: usize> BBBuffer<N> {
6363
/// is placed at `static` scope within the `.bss` region, the explicit initialization
6464
/// will be elided (as it is already performed as part of memory initialization)
6565
///
66-
/// NOTE: If the `thumbv6` feature is selected, this function takes a short critical section
66+
/// NOTE: If the `cortex-m` feature is selected, this function takes a short critical section
6767
/// while splitting.
6868
///
6969
/// ```rust
@@ -81,7 +81,7 @@ impl<'a, const N: usize> BBBuffer<N> {
8181
/// # }
8282
/// #
8383
/// # fn main() {
84-
/// # #[cfg(not(feature = "thumbv6"))]
84+
/// # #[cfg(not(feature = "cortex-m"))]
8585
/// # bbqtest();
8686
/// # }
8787
/// ```
@@ -123,7 +123,7 @@ impl<'a, const N: usize> BBBuffer<N> {
123123
/// is placed at `static` scope within the `.bss` region, the explicit initialization
124124
/// will be elided (as it is already performed as part of memory initialization)
125125
///
126-
/// NOTE: If the `thumbv6` feature is selected, this function takes a short critical
126+
/// NOTE: If the `cortex-m` feature is selected, this function takes a short critical
127127
/// section while splitting.
128128
pub fn try_split_framed(&'a self) -> Result<(FrameProducer<'a, N>, FrameConsumer<'a, N>)> {
129129
let (producer, consumer) = self.try_split()?;
@@ -159,7 +159,7 @@ impl<'a, const N: usize> BBBuffer<N> {
159159
/// # }
160160
/// #
161161
/// # fn main() {
162-
/// # #[cfg(not(feature = "thumbv6"))]
162+
/// # #[cfg(not(feature = "cortex-m"))]
163163
/// # bbqtest();
164164
/// # }
165165
/// ```
@@ -345,7 +345,7 @@ impl<'a, const N: usize> Producer<'a, N> {
345345
/// # }
346346
/// #
347347
/// # fn main() {
348-
/// # #[cfg(not(feature = "thumbv6"))]
348+
/// # #[cfg(not(feature = "cortex-m"))]
349349
/// # bbqtest();
350350
/// # }
351351
/// ```
@@ -443,7 +443,7 @@ impl<'a, const N: usize> Producer<'a, N> {
443443
/// # }
444444
/// #
445445
/// # fn main() {
446-
/// # #[cfg(not(feature = "thumbv6"))]
446+
/// # #[cfg(not(feature = "cortex-m"))]
447447
/// # bbqtest();
448448
/// # }
449449
/// ```
@@ -548,7 +548,7 @@ impl<'a, const N: usize> Consumer<'a, N> {
548548
/// # }
549549
/// #
550550
/// # fn main() {
551-
/// # #[cfg(not(feature = "thumbv6"))]
551+
/// # #[cfg(not(feature = "cortex-m"))]
552552
/// # bbqtest();
553553
/// # }
554554
/// ```
@@ -674,7 +674,7 @@ impl<const N: usize> BBBuffer<N> {
674674
/// # }
675675
/// #
676676
/// # fn main() {
677-
/// # #[cfg(not(feature = "thumbv6"))]
677+
/// # #[cfg(not(feature = "cortex-m"))]
678678
/// # bbqtest();
679679
/// # }
680680
/// ```
@@ -691,7 +691,7 @@ impl<const N: usize> BBBuffer<N> {
691691
/// automatically be committed with `to_commit()`, then no bytes
692692
/// will be comitted for writing.
693693
///
694-
/// If the `thumbv6` feature is selected, dropping the grant
694+
/// If the `cortex-m` feature is selected, dropping the grant
695695
/// without committing it takes a short critical section,
696696
#[derive(Debug, PartialEq)]
697697
pub struct GrantW<'a, const N: usize> {
@@ -712,7 +712,7 @@ unsafe impl<'a, const N: usize> Send for GrantW<'a, N> {}
712712
/// as read.
713713
///
714714
///
715-
/// If the `thumbv6` feature is selected, dropping the grant
715+
/// If the `cortex-m` feature is selected, dropping the grant
716716
/// without releasing it takes a short critical section,
717717
#[derive(Debug, PartialEq)]
718718
pub struct GrantR<'a, const N: usize> {
@@ -744,7 +744,7 @@ impl<'a, const N: usize> GrantW<'a, N> {
744744
/// If `used` is larger than the given grant, the maximum amount will
745745
/// be commited
746746
///
747-
/// NOTE: If the `thumbv6` feature is selected, this function takes a short critical
747+
/// NOTE: If the `cortex-m` feature is selected, this function takes a short critical
748748
/// section while committing.
749749
pub fn commit(mut self, used: usize) {
750750
self.commit_inner(used);
@@ -770,7 +770,7 @@ impl<'a, const N: usize> GrantW<'a, N> {
770770
/// # }
771771
/// #
772772
/// # fn main() {
773-
/// # #[cfg(not(feature = "thumbv6"))]
773+
/// # #[cfg(not(feature = "cortex-m"))]
774774
/// # bbqtest();
775775
/// # }
776776
/// ```
@@ -861,7 +861,7 @@ impl<'a, const N: usize> GrantR<'a, N> {
861861
/// If `used` is larger than the given grant, the full grant will
862862
/// be released.
863863
///
864-
/// NOTE: If the `thumbv6` feature is selected, this function takes a short critical
864+
/// NOTE: If the `cortex-m` feature is selected, this function takes a short critical
865865
/// section while releasing.
866866
pub fn release(mut self, used: usize) {
867867
// Saturate the grant release
@@ -903,7 +903,7 @@ impl<'a, const N: usize> GrantR<'a, N> {
903903
/// # }
904904
/// #
905905
/// # fn main() {
906-
/// # #[cfg(not(feature = "thumbv6"))]
906+
/// # #[cfg(not(feature = "cortex-m"))]
907907
/// # bbqtest();
908908
/// # }
909909
/// ```
@@ -969,7 +969,7 @@ impl<'a, const N: usize> SplitGrantR<'a, N> {
969969
/// If `used` is larger than the given grant, the full grant will
970970
/// be released.
971971
///
972-
/// NOTE: If the `thumbv6` feature is selected, this function takes a short critical
972+
/// NOTE: If the `cortex-m` feature is selected, this function takes a short critical
973973
/// section while releasing.
974974
pub fn release(mut self, used: usize) {
975975
// Saturate the grant release
@@ -1004,7 +1004,7 @@ impl<'a, const N: usize> SplitGrantR<'a, N> {
10041004
/// # }
10051005
/// #
10061006
/// # fn main() {
1007-
/// # #[cfg(not(feature = "thumbv6"))]
1007+
/// # #[cfg(not(feature = "cortex-m"))]
10081008
/// # bbqtest();
10091009
/// # }
10101010
/// ```
@@ -1102,7 +1102,7 @@ impl<'a, const N: usize> DerefMut for GrantR<'a, N> {
11021102
}
11031103
}
11041104

1105-
#[cfg(feature = "thumbv6")]
1105+
#[cfg(feature = "cortex-m")]
11061106
mod atomic {
11071107
use core::sync::atomic::{
11081108
AtomicBool, AtomicUsize,
@@ -1138,7 +1138,7 @@ mod atomic {
11381138
}
11391139
}
11401140

1141-
#[cfg(not(feature = "thumbv6"))]
1141+
#[cfg(not(feature = "cortex-m"))]
11421142
mod atomic {
11431143
use core::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
11441144

Diff for: core/src/framed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
//! # }
3535
//! #
3636
//! # fn main() {
37-
//! # #[cfg(not(feature = "thumbv6"))]
37+
//! # #[cfg(not(feature = "cortex-m"))]
3838
//! # bbqtest();
3939
//! # }
4040
//! ```

Diff for: core/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
//! (mostly embedded) platforms atomic support is limited and with the default features you will get
9191
//! a compiler error about missing atomic methods.
9292
//!
93-
//! This crate contains special support for Cortex-M0(+) targets with the `thumbv6` feature. By
93+
//! This crate contains special support for Cortex-M0(+) targets with the `cortex-m` feature. By
9494
//! enabling the feature, unsupported atomic operations will be replaced with critical sections
9595
//! implemented by disabling interrupts. The critical sections are very short, a few instructions at
9696
//! most, so they should make no difference to most applications.

0 commit comments

Comments
 (0)