aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7/src/bin/camera.rs
diff options
context:
space:
mode:
authorAdam Greig <[email protected]>2023-10-15 00:57:25 +0100
committerAdam Greig <[email protected]>2023-10-15 01:30:12 +0100
commit0621e957a0ddc7010d46b3ea3ddc8b9852bc8333 (patch)
treef6caefe939109e55a73e9141c736d2f6c20f51e8 /examples/stm32h7/src/bin/camera.rs
parent7559f9e5834799b041d899767ef4305dcfdf0181 (diff)
time: Update examples, tests, and other code to use new Timer::after_x convenience methods
Diffstat (limited to 'examples/stm32h7/src/bin/camera.rs')
-rw-r--r--examples/stm32h7/src/bin/camera.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/stm32h7/src/bin/camera.rs b/examples/stm32h7/src/bin/camera.rs
index 40ef16cfc..8195430b2 100644
--- a/examples/stm32h7/src/bin/camera.rs
+++ b/examples/stm32h7/src/bin/camera.rs
@@ -9,7 +9,7 @@ use embassy_stm32::i2c::I2c;
9use embassy_stm32::rcc::{Mco, Mco1Source, McoPrescaler}; 9use embassy_stm32::rcc::{Mco, Mco1Source, McoPrescaler};
10use embassy_stm32::time::khz; 10use embassy_stm32::time::khz;
11use embassy_stm32::{bind_interrupts, i2c, peripherals, Config}; 11use embassy_stm32::{bind_interrupts, i2c, peripherals, Config};
12use embassy_time::{Duration, Timer}; 12use embassy_time::Timer;
13use ov7725::*; 13use ov7725::*;
14use {defmt_rtt as _, panic_probe as _}; 14use {defmt_rtt as _, panic_probe as _};
15 15
@@ -86,11 +86,11 @@ async fn main(_spawner: Spawner) {
86 loop { 86 loop {
87 defmt::info!("high"); 87 defmt::info!("high");
88 led.set_high(); 88 led.set_high();
89 Timer::after(Duration::from_millis(500)).await; 89 Timer::after_millis(500).await;
90 90
91 defmt::info!("low"); 91 defmt::info!("low");
92 led.set_low(); 92 led.set_low();
93 Timer::after(Duration::from_millis(500)).await; 93 Timer::after_millis(500).await;
94 } 94 }
95} 95}
96 96
@@ -99,7 +99,7 @@ mod ov7725 {
99 99
100 use defmt::Format; 100 use defmt::Format;
101 use embassy_stm32::rcc::{Mco, McoInstance}; 101 use embassy_stm32::rcc::{Mco, McoInstance};
102 use embassy_time::{Duration, Timer}; 102 use embassy_time::Timer;
103 use embedded_hal_async::i2c::I2c; 103 use embedded_hal_async::i2c::I2c;
104 104
105 #[repr(u8)] 105 #[repr(u8)]
@@ -210,9 +210,9 @@ mod ov7725 {
210 } 210 }
211 211
212 pub async fn init(&mut self) -> Result<(), Error<Bus::Error>> { 212 pub async fn init(&mut self) -> Result<(), Error<Bus::Error>> {
213 Timer::after(Duration::from_millis(500)).await; 213 Timer::after_millis(500).await;
214 self.reset_regs().await?; 214 self.reset_regs().await?;
215 Timer::after(Duration::from_millis(500)).await; 215 Timer::after_millis(500).await;
216 self.set_pixformat().await?; 216 self.set_pixformat().await?;
217 self.set_resolution().await?; 217 self.set_resolution().await?;
218 Ok(()) 218 Ok(())