aboutsummaryrefslogtreecommitdiff
path: root/rtic-monotonics/src/nrf/rtc.rs
diff options
context:
space:
mode:
authordatdenkikniet <jcdra1@gmail.com>2023-04-13 18:10:29 +0200
committerdatdenkikniet <jcdra1@gmail.com>2023-04-15 19:19:49 +0200
commit401c636215f02e750939e550bc02622ea7834f3c (patch)
tree8e527dc21a2e6c55d8a297cccdaa726172e66f79 /rtic-monotonics/src/nrf/rtc.rs
parentef8046b060a375fd5e6b23d62c3a9a303bbd6e11 (diff)
rtic-monotonics: Add some docs
Diffstat (limited to 'rtic-monotonics/src/nrf/rtc.rs')
-rw-r--r--rtic-monotonics/src/nrf/rtc.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/rtic-monotonics/src/nrf/rtc.rs b/rtic-monotonics/src/nrf/rtc.rs
index 2e23389..50087ab 100644
--- a/rtic-monotonics/src/nrf/rtc.rs
+++ b/rtic-monotonics/src/nrf/rtc.rs
@@ -1,4 +1,4 @@
-//! RTIC Monotonic impl for the nRF RTCs.
+//! [`Monotonic`] implementation for the nRF Real Time Clocks (RTC).
//!
//! # Example
//!
@@ -82,6 +82,10 @@ macro_rules! create_nrf_rtc1_monotonic_token {
/// Register the Rtc2 interrupt for the monotonic.
#[cfg(any(feature = "nrf52832", feature = "nrf52833", feature = "nrf52840"))]
+#[cfg_attr(
+ docsrs,
+ doc(cfg(any(feature = "nrf52832", feature = "nrf52833", feature = "nrf52840")))
+)]
#[macro_export]
macro_rules! create_nrf_rtc2_monotonic_token {
() => {{
@@ -90,8 +94,11 @@ macro_rules! create_nrf_rtc2_monotonic_token {
}
macro_rules! make_rtc {
- ($mono_name:ident, $rtc:ident, $overflow:ident, $tq:ident) => {
+ ($mono_name:ident, $rtc:ident, $overflow:ident, $tq:ident$(, doc: ($($doc:tt)*))?) => {
/// Monotonic timer queue implementation.
+ $(
+ #[cfg_attr(docsrs, doc(cfg($($doc)*)))]
+ )?
pub struct $mono_name;
static $overflow: AtomicU32 = AtomicU32::new(0);
@@ -243,4 +250,4 @@ macro_rules! make_rtc {
make_rtc!(Rtc0, RTC0, RTC0_OVERFLOWS, RTC0_TQ);
make_rtc!(Rtc1, RTC1, RTC1_OVERFLOWS, RTC1_TQ);
#[cfg(any(feature = "nrf52832", feature = "nrf52833", feature = "nrf52840"))]
-make_rtc!(Rtc2, RTC2, RTC2_OVERFLOWS, RTC2_TQ);
+make_rtc!(Rtc2, RTC2, RTC2_OVERFLOWS, RTC2_TQ, doc: (any(feature = "nrf52832", feature = "nrf52833", feature = "nrf52840")));