From 004a28599946b53758cedc2bef41b86048c8182a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael?= <40151420+ldericher@users.noreply.github.com> Date: Mon, 11 Mar 2024 23:03:30 +0000 Subject: [PATCH] rename "delay" -> "delay_us" --- bluepill-rs/src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bluepill-rs/src/main.rs b/bluepill-rs/src/main.rs index c9c0166..96f9233 100644 --- a/bluepill-rs/src/main.rs +++ b/bluepill-rs/src/main.rs @@ -25,7 +25,7 @@ mod app { #[local] struct Local { tx: Option, dma::dma1::C4>>, - delay: timer::Delay, + delay_us: timer::DelayUs, led: gpio::gpioc::PC13, } @@ -79,7 +79,7 @@ mod app { tx: Some(serial.tx.with_dma(dma1.4)), // Configure timer - delay: cx.device.TIM1.delay_us(&clocks), + delay_us: cx.device.TIM2.delay_us(&clocks), // Configure gpio C pin 13 as a push-pull output. The `crh` register is passed to the function // in order to configure the port. For pins 0-7, crl should be passed instead. @@ -89,17 +89,17 @@ mod app { ) } - #[idle(local = [tx, delay, led], shared = [&buffer])] + #[idle(local = [tx, delay_us, led], shared = [&buffer])] fn idle(cx: idle::Context) -> ! { let mut tx = cx.local.tx.take().unwrap(); loop { let xfer = tx.write(cx.shared.buffer); - cx.local.delay.delay(1.secs()); + cx.local.delay_us.delay(1.secs()); cx.local.led.set_high(); - cx.local.delay.delay(1.secs()); + cx.local.delay_us.delay(1.secs()); cx.local.led.set_low(); (_, tx) = xfer.wait();