aboutsummaryrefslogtreecommitdiff
path: root/tests/stm32/src/bin/dac.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stm32/src/bin/dac.rs')
-rw-r--r--tests/stm32/src/bin/dac.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/stm32/src/bin/dac.rs b/tests/stm32/src/bin/dac.rs
index fb7a84b1b..10e3c3e81 100644
--- a/tests/stm32/src/bin/dac.rs
+++ b/tests/stm32/src/bin/dac.rs
@@ -12,7 +12,7 @@ use embassy_executor::Spawner;
12use embassy_stm32::adc::Adc; 12use embassy_stm32::adc::Adc;
13use embassy_stm32::dac::{DacCh1, DacChannel, Value}; 13use embassy_stm32::dac::{DacCh1, DacChannel, Value};
14use embassy_stm32::dma::NoDma; 14use embassy_stm32::dma::NoDma;
15use embassy_time::{Delay, Duration, Timer}; 15use embassy_time::{Delay, Timer};
16use {defmt_rtt as _, panic_probe as _}; 16use {defmt_rtt as _, panic_probe as _};
17 17
18#[embassy_executor::main] 18#[embassy_executor::main]
@@ -38,7 +38,7 @@ async fn main(_spawner: Spawner) {
38 38
39 unwrap!(dac.set(Value::Bit8(0))); 39 unwrap!(dac.set(Value::Bit8(0)));
40 // Now wait a little to obtain a stable value 40 // Now wait a little to obtain a stable value
41 Timer::after(Duration::from_millis(30)).await; 41 Timer::after_millis(30).await;
42 let offset = adc.read(&mut unsafe { embassy_stm32::Peripherals::steal() }.PA4); 42 let offset = adc.read(&mut unsafe { embassy_stm32::Peripherals::steal() }.PA4);
43 43
44 for v in 0..=255 { 44 for v in 0..=255 {
@@ -47,7 +47,7 @@ async fn main(_spawner: Spawner) {
47 unwrap!(dac.set(Value::Bit8(dac_output_val))); 47 unwrap!(dac.set(Value::Bit8(dac_output_val)));
48 48
49 // Now wait a little to obtain a stable value 49 // Now wait a little to obtain a stable value
50 Timer::after(Duration::from_millis(30)).await; 50 Timer::after_millis(30).await;
51 51
52 // Need to steal the peripherals here because PA4 is obviously in use already 52 // Need to steal the peripherals here because PA4 is obviously in use already
53 let measured = adc.read(&mut unsafe { embassy_stm32::Peripherals::steal() }.PA4); 53 let measured = adc.read(&mut unsafe { embassy_stm32::Peripherals::steal() }.PA4);