Native delay API does not need self

This commit is contained in:
ivmarkov 2022-09-25 12:17:59 +03:00
parent 83c1ebf4b7
commit 22ab6f272a
4 changed files with 8 additions and 8 deletions

View File

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

View File

@ -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!");

View File

@ -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(())
}

View File

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