feat: Block on timer calls, remove Option<> results
This commit is contained in:
parent
d480362490
commit
d1c703227e
@ -35,7 +35,7 @@
|
|||||||
//!
|
//!
|
||||||
//! periodic.start(1.secs());
|
//! periodic.start(1.secs());
|
||||||
//! loop {
|
//! loop {
|
||||||
//! while periodic.wait().is_none() {}
|
//! periodic.wait();
|
||||||
//! }
|
//! }
|
||||||
//! # }
|
//! # }
|
||||||
//! ```
|
//! ```
|
||||||
@ -311,14 +311,9 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// "Wait" until the count down finishes without blocking.
|
/// "Wait" until the count down finishes without blocking.
|
||||||
pub fn wait(&mut self) -> Option<()> {
|
pub fn wait(&mut self) {
|
||||||
if self.inner.is_interrupt_set() {
|
while !self.inner.is_interrupt_set() {}
|
||||||
self.inner.clear_interrupt();
|
self.inner.clear_interrupt();
|
||||||
|
|
||||||
Some(())
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Tries to cancel the active count down.
|
/// Tries to cancel the active count down.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user