Skip to content

Commit 5f3855e

Browse files
committed
More clean up of example
1 parent ad4b87a commit 5f3855e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

examples/opamp.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ fn main() -> ! {
6464
let mut opamp2 = opamp2.pga(
6565
pa7,
6666
PgaModeInternal::gain(NonInvertingGain::Gain4),
67-
//Some(gpioa.pa6),
6867
Option::<PA6<Analog>>::None, // Do not route output to any external pin, use internal AD instead
6968
);
7069

@@ -75,7 +74,10 @@ fn main() -> ! {
7574

7675
loop {
7776
// Here we can sample the output of opamp2 as if it was a regular AD pin
78-
let sample = adc.convert(&mut opamp2, stm32g4xx_hal::adc::config::SampleTime::Cycles_640_5);
77+
let sample = adc.convert(
78+
&mut opamp2,
79+
stm32g4xx_hal::adc::config::SampleTime::Cycles_640_5,
80+
);
7981

8082
let millivolts = adc.sample_to_millivolts(sample);
8183
info!("opamp2 thus 4x pa7: {}mV", millivolts);

src/adc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ pub use crate::time::U32Ext as _;
1313
use crate::{
1414
dma::{mux::DmaMuxResources, traits::TargetAddress, PeripheralToMemory},
1515
gpio::*,
16+
opamp,
1617
rcc::{Enable, Rcc, Reset},
1718
signature::{VtempCal110, VtempCal30, VDDA_CALIB},
18-
stm32, opamp,
19+
stm32,
1920
};
2021
use core::fmt;
2122
use core::marker::PhantomData;

0 commit comments

Comments
 (0)