Skip to content

Commit f2c2056

Browse files
committed
Add documentation about wakeup timer
1 parent cfc9851 commit f2c2056

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/rtc.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,18 @@ impl Default for Interrupts {
453453

454454

455455
/// The RTC wakeup timer
456+
///
457+
/// This timer can be used in two ways:
458+
/// 1. Continually call `wait` until it returns `Ok(())`.
459+
/// 2. Set up the RTC interrupt.
460+
///
461+
/// If you use an interrupt, you should still call `wait` once, after the
462+
/// interrupt fired. This should return `Ok(())` immediately. Doing this will
463+
/// reset the timer flag. If you don't do this, the interrupt will not fire
464+
/// again, if you go to sleep.
465+
///
466+
/// You don't need to call `wait`, if you call `cancel`, as that also resets the
467+
/// flag. Restarting the timer by calling `start` will also reset the flag.
456468
pub struct WakeupTimer<'r> {
457469
rtc: &'r mut RTC,
458470
}

0 commit comments

Comments
 (0)