Do not invert ADC readings when using ESP32 (#1093)
* Do not invert ADC readings when using ESP32 * Update `CHANGELOG.md`
This commit is contained in:
parent
99c46d6a4e
commit
a5a58291e3
@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Fix double &mut for the `SetDutyCycle` impl on `PwmPin` (#1033)
|
||||
- ESP32/ESP32-S3: Fix stack-top calculation for app-core (#1081)
|
||||
- ESP32/ESP32-S2/ESP32-S3: Fix embassy-time-timg0 driver (#1091)
|
||||
- ESP32: ADC readings are no longer inverted (#1093)
|
||||
|
||||
### Removed
|
||||
|
||||
|
||||
@ -336,6 +336,12 @@ where
|
||||
.sar_meas_wait2()
|
||||
.modify(|_, w| unsafe { w.sar_amp_wait3().bits(1) });
|
||||
|
||||
// Do *not* invert the output
|
||||
// NOTE: This seems backwards, but was verified experimentally.
|
||||
sensors
|
||||
.sar_read_ctrl2()
|
||||
.modify(|_, w| w.sar2_data_inv().set_bit());
|
||||
|
||||
let adc = ADC {
|
||||
_adc: adc_instance.into_ref(),
|
||||
attenuations: config.attenuations,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user