From 22ab6f272a0cea1ef398b3476a7699826f1aac78 Mon Sep 17 00:00:00 2001 From: ivmarkov Date: Sun, 25 Sep 2022 12:17:59 +0300 Subject: [PATCH] Native delay API does not need self --- examples/ledc-simple.rs | 4 ++-- examples/rmt_morse_code.rs | 4 ++-- examples/rmt_musical_buzzer.rs | 6 +++--- examples/rmt_neopixel.rs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/ledc-simple.rs b/examples/ledc-simple.rs index acc552cd1..abb012c6c 100644 --- a/examples/ledc-simple.rs +++ b/examples/ledc-simple.rs @@ -25,10 +25,10 @@ fn main() -> anyhow::Result<()> { for numerator in [0, 1, 2, 3, 4, 5].iter().cycle() { println!("Duty {}/5", numerator); channel.set_duty(max_duty * numerator / 5)?; - FreeRtos::delay_ms(2000)?; + FreeRtos::delay_ms(2000); } loop { - FreeRtos::delay_ms(1000)?; + FreeRtos::delay_ms(1000); } } diff --git a/examples/rmt_morse_code.rs b/examples/rmt_morse_code.rs index 4985a1aec..cda6d2752 100644 --- a/examples/rmt_morse_code.rs +++ b/examples/rmt_morse_code.rs @@ -47,7 +47,7 @@ fn main() -> anyhow::Result<()> { println!("Keep sending until pin {} is set low.", stop.pin()); while stop.is_high() { - Ets::delay_ms(100)?; + Ets::delay_ms(100); } println!("Pin {} set to low. Stopped.", stop.pin()); @@ -56,7 +56,7 @@ fn main() -> anyhow::Result<()> { drop(tx); // Wait so the messages don't get garbled. - Ets::delay_ms(3000)?; + Ets::delay_ms(3000); // Now send a single message and stop. println!("Saying GOODBYE!"); diff --git a/examples/rmt_musical_buzzer.rs b/examples/rmt_musical_buzzer.rs index 404696625..d1a4ba27e 100644 --- a/examples/rmt_musical_buzzer.rs +++ b/examples/rmt_musical_buzzer.rs @@ -26,7 +26,7 @@ fn main() -> anyhow::Result<()> { loop { play_song(&mut tx, ODE_TO_JOY)?; - Ets::delay_ms(3000)?; + Ets::delay_ms(3000); } } @@ -58,11 +58,11 @@ pub fn play_note( // Play the note for the 80% of the duration. tx.start(signal)?; - Ets::delay_ms((80 * duration.as_millis() / 100) as u32)?; + Ets::delay_ms((80 * duration.as_millis() / 100) as u32); // Small pause between notes, 20% of the specified duration. tx.stop()?; - Ets::delay_ms((20 * duration.as_millis() / 100) as u32)?; + Ets::delay_ms((20 * duration.as_millis() / 100) as u32); Ok(()) } diff --git a/examples/rmt_neopixel.rs b/examples/rmt_neopixel.rs index e9c0e2b40..93230997a 100644 --- a/examples/rmt_neopixel.rs +++ b/examples/rmt_neopixel.rs @@ -45,7 +45,7 @@ fn main() -> anyhow::Result<()> { signal.set(i as usize, &(high_pulse, low_pulse))?; } tx.start_blocking(&signal)?; - Ets::delay_ms(1000)?; + Ets::delay_ms(1000); } } }