Merge pull request #14 from timokroeger/uarte-power-optimization
UARTE power optimization and improvements
This commit is contained in:
@ -63,12 +63,7 @@ impl<T: Send> Signal<T> {
|
||||
futures::future::poll_fn(move |cx| self.poll_wait(cx))
|
||||
}
|
||||
|
||||
/// Blocks until the signal has been received.
|
||||
///
|
||||
/// Returns immediately when [`poll_wait()`] has not been called before.
|
||||
pub fn blocking_wait(&self) {
|
||||
while cortex_m::interrupt::free(|_| {
|
||||
matches!(unsafe { &*self.state.get() }, State::Waiting(_))
|
||||
}) {}
|
||||
pub fn signaled(&self) -> bool {
|
||||
cortex_m::interrupt::free(|_| matches!(unsafe { &*self.state.get() }, State::Signaled(_)))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user