diff options
Diffstat (limited to 'examples/stm32f7')
| -rw-r--r-- | examples/stm32f7/src/bin/adc.rs | 4 | ||||
| -rw-r--r-- | examples/stm32f7/src/bin/blinky.rs | 6 | ||||
| -rw-r--r-- | examples/stm32f7/src/bin/can.rs | 2 | ||||
| -rw-r--r-- | examples/stm32f7/src/bin/eth.rs | 6 | ||||
| -rw-r--r-- | examples/stm32f7/src/bin/flash.rs | 4 | ||||
| -rw-r--r-- | examples/stm32f7/src/bin/hello.rs | 4 |
6 files changed, 13 insertions, 13 deletions
diff --git a/examples/stm32f7/src/bin/adc.rs b/examples/stm32f7/src/bin/adc.rs index bc4ed2892..48c59eaf0 100644 --- a/examples/stm32f7/src/bin/adc.rs +++ b/examples/stm32f7/src/bin/adc.rs | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | use defmt::*; | 5 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::adc::Adc; | 7 | use embassy_stm32::adc::Adc; |
| 8 | use embassy_time::{Delay, Duration, Timer}; | 8 | use embassy_time::{Delay, Timer}; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy_executor::main] | 11 | #[embassy_executor::main] |
| @@ -29,6 +29,6 @@ async fn main(_spawner: Spawner) { | |||
| 29 | loop { | 29 | loop { |
| 30 | let v = adc.read(&mut pin); | 30 | let v = adc.read(&mut pin); |
| 31 | info!("--> {} - {} mV", v, convert_to_millivolts(v)); | 31 | info!("--> {} - {} mV", v, convert_to_millivolts(v)); |
| 32 | Timer::after(Duration::from_millis(100)).await; | 32 | Timer::after_millis(100).await; |
| 33 | } | 33 | } |
| 34 | } | 34 | } |
diff --git a/examples/stm32f7/src/bin/blinky.rs b/examples/stm32f7/src/bin/blinky.rs index b27bee4ce..4bfc5a50d 100644 --- a/examples/stm32f7/src/bin/blinky.rs +++ b/examples/stm32f7/src/bin/blinky.rs | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | use defmt::*; | 5 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::gpio::{Level, Output, Speed}; | 7 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 8 | use embassy_time::{Duration, Timer}; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy_executor::main] | 11 | #[embassy_executor::main] |
| @@ -18,10 +18,10 @@ async fn main(_spawner: Spawner) { | |||
| 18 | loop { | 18 | loop { |
| 19 | info!("high"); | 19 | info!("high"); |
| 20 | led.set_high(); | 20 | led.set_high(); |
| 21 | Timer::after(Duration::from_millis(300)).await; | 21 | Timer::after_millis(300).await; |
| 22 | 22 | ||
| 23 | info!("low"); | 23 | info!("low"); |
| 24 | led.set_low(); | 24 | led.set_low(); |
| 25 | Timer::after(Duration::from_millis(300)).await; | 25 | Timer::after_millis(300).await; |
| 26 | } | 26 | } |
| 27 | } | 27 | } |
diff --git a/examples/stm32f7/src/bin/can.rs b/examples/stm32f7/src/bin/can.rs index e9650f23a..78b21ceaa 100644 --- a/examples/stm32f7/src/bin/can.rs +++ b/examples/stm32f7/src/bin/can.rs | |||
| @@ -26,7 +26,7 @@ pub async fn send_can_message(tx: &'static mut CanTx<'static, 'static, CAN3>) { | |||
| 26 | loop { | 26 | loop { |
| 27 | let frame = Frame::new_data(unwrap!(StandardId::new(0 as _)), [0]); | 27 | let frame = Frame::new_data(unwrap!(StandardId::new(0 as _)), [0]); |
| 28 | tx.write(&frame).await; | 28 | tx.write(&frame).await; |
| 29 | embassy_time::Timer::after(embassy_time::Duration::from_secs(1)).await; | 29 | embassy_time::Timer::after_secs(1).await; |
| 30 | } | 30 | } |
| 31 | } | 31 | } |
| 32 | 32 | ||
diff --git a/examples/stm32f7/src/bin/eth.rs b/examples/stm32f7/src/bin/eth.rs index 7c9ee1590..d50473b9d 100644 --- a/examples/stm32f7/src/bin/eth.rs +++ b/examples/stm32f7/src/bin/eth.rs | |||
| @@ -12,7 +12,7 @@ use embassy_stm32::peripherals::ETH; | |||
| 12 | use embassy_stm32::rng::Rng; | 12 | use embassy_stm32::rng::Rng; |
| 13 | use embassy_stm32::time::mhz; | 13 | use embassy_stm32::time::mhz; |
| 14 | use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; | 14 | use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; |
| 15 | use embassy_time::{Duration, Timer}; | 15 | use embassy_time::Timer; |
| 16 | use embedded_io_async::Write; | 16 | use embedded_io_async::Write; |
| 17 | use rand_core::RngCore; | 17 | use rand_core::RngCore; |
| 18 | use static_cell::make_static; | 18 | use static_cell::make_static; |
| @@ -100,7 +100,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 100 | let r = socket.connect(remote_endpoint).await; | 100 | let r = socket.connect(remote_endpoint).await; |
| 101 | if let Err(e) = r { | 101 | if let Err(e) = r { |
| 102 | info!("connect error: {:?}", e); | 102 | info!("connect error: {:?}", e); |
| 103 | Timer::after(Duration::from_secs(1)).await; | 103 | Timer::after_secs(1).await; |
| 104 | continue; | 104 | continue; |
| 105 | } | 105 | } |
| 106 | info!("connected!"); | 106 | info!("connected!"); |
| @@ -111,7 +111,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 111 | info!("write error: {:?}", e); | 111 | info!("write error: {:?}", e); |
| 112 | break; | 112 | break; |
| 113 | } | 113 | } |
| 114 | Timer::after(Duration::from_secs(1)).await; | 114 | Timer::after_secs(1).await; |
| 115 | } | 115 | } |
| 116 | } | 116 | } |
| 117 | } | 117 | } |
diff --git a/examples/stm32f7/src/bin/flash.rs b/examples/stm32f7/src/bin/flash.rs index 35d3059be..06a94f1c8 100644 --- a/examples/stm32f7/src/bin/flash.rs +++ b/examples/stm32f7/src/bin/flash.rs | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::flash::Flash; | 7 | use embassy_stm32::flash::Flash; |
| 8 | use embassy_time::{Duration, Timer}; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy_executor::main] | 11 | #[embassy_executor::main] |
| @@ -16,7 +16,7 @@ async fn main(_spawner: Spawner) { | |||
| 16 | const ADDR: u32 = 0x8_0000; // This is the offset into the third region, the absolute address is 4x32K + 128K + 0x8_0000. | 16 | const ADDR: u32 = 0x8_0000; // This is the offset into the third region, the absolute address is 4x32K + 128K + 0x8_0000. |
| 17 | 17 | ||
| 18 | // wait a bit before accessing the flash | 18 | // wait a bit before accessing the flash |
| 19 | Timer::after(Duration::from_millis(300)).await; | 19 | Timer::after_millis(300).await; |
| 20 | 20 | ||
| 21 | let mut f = Flash::new_blocking(p.FLASH).into_blocking_regions().bank1_region3; | 21 | let mut f = Flash::new_blocking(p.FLASH).into_blocking_regions().bank1_region3; |
| 22 | 22 | ||
diff --git a/examples/stm32f7/src/bin/hello.rs b/examples/stm32f7/src/bin/hello.rs index c409703f5..27ee83aa5 100644 --- a/examples/stm32f7/src/bin/hello.rs +++ b/examples/stm32f7/src/bin/hello.rs | |||
| @@ -6,7 +6,7 @@ use defmt::info; | |||
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::time::Hertz; | 7 | use embassy_stm32::time::Hertz; |
| 8 | use embassy_stm32::Config; | 8 | use embassy_stm32::Config; |
| 9 | use embassy_time::{Duration, Timer}; | 9 | use embassy_time::Timer; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy_executor::main] | 12 | #[embassy_executor::main] |
| @@ -17,6 +17,6 @@ async fn main(_spawner: Spawner) -> ! { | |||
| 17 | 17 | ||
| 18 | loop { | 18 | loop { |
| 19 | info!("Hello World!"); | 19 | info!("Hello World!"); |
| 20 | Timer::after(Duration::from_secs(1)).await; | 20 | Timer::after_secs(1).await; |
| 21 | } | 21 | } |
| 22 | } | 22 | } |
