Skip to content

Commit 1599b06

Browse files
authored
Merge pull request #645 from jannic-dev-forks/atomic-docsrs
Show features required for AtomicDevice in docs
2 parents 055a619 + 3a5d90e commit 1599b06

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

+8
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ 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(
30+
docsrs,
31+
doc(cfg(any(feature = "portable-atomic", target_has_atomic = "8")))
32+
)]
2933
pub struct AtomicDevice<'a, BUS, CS, D> {
3034
bus: &'a AtomicCell<BUS>,
3135
cs: CS,
@@ -34,6 +38,10 @@ pub struct AtomicDevice<'a, BUS, CS, D> {
3438

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

0 commit comments

Comments
 (0)