Skip to content

Commit 3cda292

Browse files
committed
Clearer explanation for _mv and _cal
1 parent 2eaf7bb commit 3cda292

File tree

1 file changed

+6
-8
lines changed
  • esp-hal/src/soc/esp32s2/efuse

1 file changed

+6
-8
lines changed

esp-hal/src/soc/esp32s2/efuse/mod.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,9 @@ impl Efuse {
216216
}
217217
}
218218

219-
/// Return the calibration voltage in mV. It's only used in the calculation
220-
/// of the AdcCalLine::new_cal calibration. There it is assumed that this
221-
/// value has already been corrected for the intercept, so we do that
222-
/// explicityly here.
219+
/// Return the calibration voltage in mV. It's only used as dy in the
220+
/// slope calculation of the AdcCalLine::new_cal calibration. Correct it
221+
/// to be ready for this calculation.
223222
pub fn rtc_calib_cal_mv(adcn: usize, atten: Attenuation) -> u16 {
224223
if adcn > 2 || adcn == 0 {
225224
return 0;
@@ -242,10 +241,9 @@ impl Efuse {
242241
}) as u16
243242
}
244243

245-
/// Return the adc value for the calibration point. It's only used in the
246-
/// calculation of the AdcCalLine::new_cal calibration. There it is
247-
/// assumed that this value has already been corrected for the
248-
/// intercept, so we do that explicityly here.
244+
/// Return the calibration adc value. It's only used as dx in the
245+
/// slope calculation of the AdcCalLine::new_cal calibration. Correct it
246+
/// to be ready for this calculation.
249247
pub fn rtc_calib_cal_code(adcn: usize, atten: Attenuation) -> Option<u16> {
250248
if adcn > 2 || adcn == 0 {
251249
return None;

0 commit comments

Comments
 (0)