Skip to content

Commit 078bc35

Browse files
committed
Show features required for AtomicDevice in docs
1 parent 055a619 commit 078bc35

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ use crate::util::AtomicCell;
2626
///
2727
/// This primitive is particularly well-suited for applications that have external arbitration
2828
/// rules that prevent `Busy` errors in the first place, such as the RTIC framework.
29+
#[cfg_attr(docsrs, doc(cfg(any(feature = "portable-atomic", target_has_atomic = "8"))))]
2930
pub struct AtomicDevice<'a, BUS, CS, D> {
3031
bus: &'a AtomicCell<BUS>,
3132
cs: CS,
@@ -34,6 +35,7 @@ pub struct AtomicDevice<'a, BUS, CS, D> {
3435

3536
#[derive(Debug, Copy, Clone)]
3637
/// Wrapper type for errors returned by [`AtomicDevice`].
38+
#[cfg_attr(docsrs, doc(cfg(any(feature = "portable-atomic", target_has_atomic = "8"))))]
3739
pub enum AtomicError<T: Error> {
3840
/// This error is returned if the SPI bus was already in use when an operation was attempted,
3941
/// which indicates that the driver requirements are not being met with regard to

0 commit comments

Comments
 (0)