diff options
| author | nerwalt <[email protected]> | 2024-07-11 06:58:05 -0600 |
|---|---|---|
| committer | nerwalt <[email protected]> | 2024-07-11 06:58:05 -0600 |
| commit | 38d8abef26dbc3e28e94c367171a06e5be798a5f (patch) | |
| tree | 86813371da222191fe66fedc71dfae8098cb4d22 /tests | |
| parent | 98263ac220102a60c1f7cd3a882acafbb59b53f1 (diff) | |
| parent | ed3da1721a4f704d3f2a8a1cf84d9fc051c71945 (diff) | |
Merge branch 'main' into nrf9151
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/rp/src/bin/ethernet_w5100s_perf.rs | 3 | ||||
| -rw-r--r-- | tests/stm32/src/bin/dac.rs | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/tests/rp/src/bin/ethernet_w5100s_perf.rs b/tests/rp/src/bin/ethernet_w5100s_perf.rs index 5d5547773..4b04571bd 100644 --- a/tests/rp/src/bin/ethernet_w5100s_perf.rs +++ b/tests/rp/src/bin/ethernet_w5100s_perf.rs | |||
| @@ -59,7 +59,8 @@ async fn main(spawner: Spawner) { | |||
| 59 | w5500_int, | 59 | w5500_int, |
| 60 | w5500_reset, | 60 | w5500_reset, |
| 61 | ) | 61 | ) |
| 62 | .await; | 62 | .await |
| 63 | .unwrap(); | ||
| 63 | unwrap!(spawner.spawn(ethernet_task(runner))); | 64 | unwrap!(spawner.spawn(ethernet_task(runner))); |
| 64 | 65 | ||
| 65 | // Generate random seed | 66 | // Generate random seed |
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 | ||
