forked from M-Labs/zynq-rs
libasync: add mod delay
This commit is contained in:
parent
88a2a2bc71
commit
3b4be6a414
7
libasync/src/delay.rs
Normal file
7
libasync/src/delay.rs
Normal file
@ -0,0 +1,7 @@
|
||||
use embedded_hal::timer::CountDown;
|
||||
use crate::block_async;
|
||||
|
||||
pub async fn delay<T: CountDown<Time=C>, C>(timer: &mut T, count: C) {
|
||||
timer.start(count);
|
||||
let _ = block_async!(timer.wait()).await;
|
||||
}
|
Loading…
Reference in New Issue
Block a user