Compare commits

...

2 Commits

Author SHA1 Message Date
Astro 63d71d021c default.nix: update cargoSha256 2020-04-25 01:29:38 +02:00
Astro 3b4be6a414 libasync: add mod delay 2020-04-25 01:25:12 +02:00
2 changed files with 8 additions and 1 deletions

View File

@ -49,7 +49,7 @@ let
name = "${crate}";
src = ./.;
crateSubdir = crate;
cargoSha256 = "1fvild4mygcvnfcnmni4icg5nj16dj7hkzjpahzhpbyv9rr24722";
cargoSha256 = "02k72zj6qfbw9y69w3r9a1b1dg9pvkc7cl511hcv4w9rbnn3jlld";
cargoFeatures = features;
doCheck = false;
};

7
libasync/src/delay.rs Normal file
View 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;
}