Skip to content

Commit d346553

Browse files
committed
Also enable Atomic* when target_has_atomic=8
1 parent 797dc95 commit d346553

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

embedded-hal-bus/src/i2c/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ mod mutex;
88
pub use mutex::*;
99
mod critical_section;
1010
pub use self::critical_section::*;
11-
#[cfg(feature = "atomic-device")]
11+
#[cfg(any(feature = "atomic-device", target_has_atomic = "8"))]
1212
mod atomic;
13-
#[cfg(feature = "atomic-device")]
13+
#[cfg(any(feature = "atomic-device", target_has_atomic = "8"))]
1414
pub use atomic::*;

embedded-hal-bus/src/spi/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ pub use refcell::*;
1111
mod mutex;
1212
#[cfg(feature = "std")]
1313
pub use mutex::*;
14-
#[cfg(feature = "atomic-device")]
14+
#[cfg(any(feature = "atomic-device", target_has_atomic = "8"))]
1515
mod atomic;
1616
mod critical_section;
1717
mod shared;
18-
#[cfg(feature = "atomic-device")]
18+
#[cfg(any(feature = "atomic-device", target_has_atomic = "8"))]
1919
pub use atomic::*;
2020

2121
pub use self::critical_section::*;

embedded-hal-bus/src/util.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#[allow(unused_imports)]
44
use core::cell::UnsafeCell;
55

6-
#[cfg(feature = "atomic-device")]
6+
#[cfg(any(feature = "atomic-device", target_has_atomic = "8"))]
77
/// Cell type used by [`spi::AtomicDevice`](crate::spi::AtomicDevice) and [`i2c::AtomicDevice`](crate::i2c::AtomicDevice).
88
///
99
/// To use `AtomicDevice`, you must wrap the bus with this struct, and then
@@ -12,12 +12,12 @@ pub struct AtomicCell<BUS> {
1212
pub(crate) bus: UnsafeCell<BUS>,
1313
pub(crate) busy: portable_atomic::AtomicBool,
1414
}
15-
#[cfg(feature = "atomic-device")]
15+
#[cfg(any(feature = "atomic-device", target_has_atomic = "8"))]
1616
unsafe impl<BUS: Send> Send for AtomicCell<BUS> {}
17-
#[cfg(feature = "atomic-device")]
17+
#[cfg(any(feature = "atomic-device", target_has_atomic = "8"))]
1818
unsafe impl<BUS: Send> Sync for AtomicCell<BUS> {}
1919

20-
#[cfg(feature = "atomic-device")]
20+
#[cfg(any(feature = "atomic-device", target_has_atomic = "8"))]
2121
impl<BUS> AtomicCell<BUS> {
2222
/// Create a new `AtomicCell`
2323
pub fn new(bus: BUS) -> Self {

0 commit comments

Comments
 (0)