zynq-rs/libasync/src/delay.rs
2020-04-25 01:25:12 +02:00

8 lines
204 B
Rust

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;
}