We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
delay_us
delay_ms
1 parent 78527ac commit 5fe9c7aCopy full SHA for 5fe9c7a
src/delay.rs
@@ -14,11 +14,27 @@ impl DelayNs for Delay {
14
fn delay_ns(&mut self, n: u32) {
15
thread::sleep(Duration::from_nanos(n.into()));
16
}
17
+
18
+ fn delay_us(&mut self, n: u32) {
19
+ thread::sleep(Duration::from_micros(n.into()));
20
+ }
21
22
+ fn delay_ms(&mut self, n: u32) {
23
+ thread::sleep(Duration::from_millis(n.into()));
24
25
26
27
#[cfg(feature = "async-tokio")]
28
impl embedded_hal_async::delay::DelayNs for Delay {
29
async fn delay_ns(&mut self, n: u32) {
30
tokio::time::sleep(Duration::from_nanos(n.into())).await;
31
32
33
+ async fn delay_us(&mut self, n: u32) {
34
+ tokio::time::sleep(Duration::from_micros(n.into())).await;
35
36
37
+ async fn delay_ms(&mut self, n: u32) {
38
+ tokio::time::sleep(Duration::from_millis(n.into())).await;
39
40
0 commit comments