We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1df5d43 commit cfc9851Copy full SHA for cfc9851
src/rtc.rs
@@ -469,13 +469,15 @@ impl timer::CountDown for WakeupTimer<'_> {
469
///
470
/// # Panics
471
472
- /// The `delay` argument supports 17 bits. Panics, if a value larger than
473
- /// 17 bits is passed.
+ /// The `delay` argument must be in the range `1 <= delay <= 2^17`.
+ /// Panics, if `delay` is outside of that range.
474
fn start<T>(&mut self, delay: T)
475
where T: Into<Self::Time>
476
{
477
let delay = delay.into();
478
- assert!(delay < 2^17);
+ assert!(1 <= delay && delay <= 2^17);
479
+
480
+ let delay = delay - 1;
481
482
// Can't panic, as the error type is `Void`.
483
self.cancel().unwrap();
0 commit comments