Skip to content

Commit

Permalink
Merge pull request #645 from jannic-dev-forks/atomic-docsrs
Browse files Browse the repository at this point in the history
Show features required for AtomicDevice in docs
  • Loading branch information
Dirbaio authored Jan 26, 2025
2 parents 055a619 + 3a5d90e commit 1599b06
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions embedded-hal-bus/src/spi/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ use crate::util::AtomicCell;
///
/// This primitive is particularly well-suited for applications that have external arbitration
/// rules that prevent `Busy` errors in the first place, such as the RTIC framework.
#[cfg_attr(
docsrs,
doc(cfg(any(feature = "portable-atomic", target_has_atomic = "8")))
)]
pub struct AtomicDevice<'a, BUS, CS, D> {
bus: &'a AtomicCell<BUS>,
cs: CS,
Expand All @@ -34,6 +38,10 @@ pub struct AtomicDevice<'a, BUS, CS, D> {

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

0 comments on commit 1599b06

Please sign in to comment.