This commit is contained in:
Ulf Lilleengen 2024-01-10 09:54:35 +01:00
parent ff5f5021fb
commit de08da0bf1

View File

@ -15,7 +15,7 @@ use gpio::{AnyPin, Level, Output};
use {defmt_rtt as _, panic_probe as _};
enum LedState {
Toggle,
Toggle,
}
static CHANNEL: Channel<ThreadModeRawMutex, LedState, 64> = Channel::new();
@ -28,7 +28,10 @@ async fn main(spawner: Spawner) {
let k = 1.003;
unwrap!(spawner.spawn(toggle_led(CHANNEL.sender(), Duration::from_nanos(dt))));
unwrap!(spawner.spawn(toggle_led(CHANNEL.sender(), Duration::from_nanos((dt as f64 * k) as u64))));
unwrap!(spawner.spawn(toggle_led(
CHANNEL.sender(),
Duration::from_nanos((dt as f64 * k) as u64)
)));
loop {
match CHANNEL.receive().await {