diff options
| author | xoviat <[email protected]> | 2023-09-27 20:58:46 -0500 |
|---|---|---|
| committer | xoviat <[email protected]> | 2023-09-27 20:58:46 -0500 |
| commit | 79146c4bd5cdbd8337d0dbdfd93219b9cb330c47 (patch) | |
| tree | e10d53df45b95db09e1d74d19a3abd269b736f69 /examples/stm32f4/src/bin/adc.rs | |
| parent | 20ea76c19c709abf652b9a044292eb26fd656223 (diff) | |
stm32/adc: cleanup f1, f3, v1, and v2
Diffstat (limited to 'examples/stm32f4/src/bin/adc.rs')
| -rw-r--r-- | examples/stm32f4/src/bin/adc.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/stm32f4/src/bin/adc.rs b/examples/stm32f4/src/bin/adc.rs index 1c9a0b35d..dd10385c4 100644 --- a/examples/stm32f4/src/bin/adc.rs +++ b/examples/stm32f4/src/bin/adc.rs | |||
| @@ -24,7 +24,7 @@ async fn main(_spawner: Spawner) { | |||
| 24 | // Startup delay can be combined to the maximum of either | 24 | // Startup delay can be combined to the maximum of either |
| 25 | delay.delay_us(Temperature::start_time_us().max(VrefInt::start_time_us())); | 25 | delay.delay_us(Temperature::start_time_us().max(VrefInt::start_time_us())); |
| 26 | 26 | ||
| 27 | let vrefint_sample = adc.read_internal(&mut vrefint); | 27 | let vrefint_sample = adc.read(&mut vrefint); |
| 28 | 28 | ||
| 29 | let convert_to_millivolts = |sample| { | 29 | let convert_to_millivolts = |sample| { |
| 30 | // From http://www.st.com/resource/en/datasheet/DM00071990.pdf | 30 | // From http://www.st.com/resource/en/datasheet/DM00071990.pdf |
| @@ -55,12 +55,12 @@ async fn main(_spawner: Spawner) { | |||
| 55 | info!("PC1: {} ({} mV)", v, convert_to_millivolts(v)); | 55 | info!("PC1: {} ({} mV)", v, convert_to_millivolts(v)); |
| 56 | 56 | ||
| 57 | // Read internal temperature | 57 | // Read internal temperature |
| 58 | let v = adc.read_internal(&mut temp); | 58 | let v = adc.read(&mut temp); |
| 59 | let celcius = convert_to_celcius(v); | 59 | let celcius = convert_to_celcius(v); |
| 60 | info!("Internal temp: {} ({} C)", v, celcius); | 60 | info!("Internal temp: {} ({} C)", v, celcius); |
| 61 | 61 | ||
| 62 | // Read internal voltage reference | 62 | // Read internal voltage reference |
| 63 | let v = adc.read_internal(&mut vrefint); | 63 | let v = adc.read(&mut vrefint); |
| 64 | info!("VrefInt: {}", v); | 64 | info!("VrefInt: {}", v); |
| 65 | 65 | ||
| 66 | Timer::after(Duration::from_millis(100)).await; | 66 | Timer::after(Duration::from_millis(100)).await; |
