aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/stm32/src/bin/dac.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/stm32/src/bin/dac.rs b/tests/stm32/src/bin/dac.rs
index 06501ab14..86a68c530 100644
--- a/tests/stm32/src/bin/dac.rs
+++ b/tests/stm32/src/bin/dac.rs
@@ -38,7 +38,7 @@ async fn main(_spawner: Spawner) {
38 dac.set(Value::Bit8(0)); 38 dac.set(Value::Bit8(0));
39 // Now wait a little to obtain a stable value 39 // Now wait a little to obtain a stable value
40 Timer::after_millis(30).await; 40 Timer::after_millis(30).await;
41 let offset = adc.read(&mut adc_pin); 41 let offset = adc.blocking_read(&mut adc_pin);
42 42
43 for v in 0..=255 { 43 for v in 0..=255 {
44 // First set the DAC output value 44 // First set the DAC output value
@@ -49,7 +49,7 @@ async fn main(_spawner: Spawner) {
49 Timer::after_millis(30).await; 49 Timer::after_millis(30).await;
50 50
51 // Need to steal the peripherals here because PA4 is obviously in use already 51 // Need to steal the peripherals here because PA4 is obviously in use already
52 let measured = adc.read(&mut unsafe { embassy_stm32::Peripherals::steal() }.PA4); 52 let measured = adc.blocking_read(&mut unsafe { embassy_stm32::Peripherals::steal() }.PA4);
53 // Calibrate and normalize the measurement to get close to the dac_output_val 53 // Calibrate and normalize the measurement to get close to the dac_output_val
54 let measured_normalized = ((measured as i32 - offset as i32) / normalization_factor) as i16; 54 let measured_normalized = ((measured as i32 - offset as i32) / normalization_factor) as i16;
55 55