mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
refactor(adc_calib): Simplify 2nd step coefficient calculation
- remove unnecessary variables and calculations - improve readability of code
This commit is contained in:
@@ -63,9 +63,13 @@ uint32_t esp_efuse_rtc_calib_get_init_code(int version, uint32_t adc_unit, int a
|
||||
|
||||
esp_err_t esp_efuse_rtc_calib_get_cal_voltage(int version, uint32_t adc_unit, int atten, uint32_t *out_digi, uint32_t *out_vol_mv)
|
||||
{
|
||||
assert((version >= ESP_EFUSE_ADC_CALIB_VER_MIN) &&
|
||||
(version <= ESP_EFUSE_ADC_CALIB_VER_MAX));
|
||||
assert(atten < 4);
|
||||
if ((version < ESP_EFUSE_ADC_CALIB_VER_MIN) ||
|
||||
(version > ESP_EFUSE_ADC_CALIB_VER_MAX)) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
if (atten >= 4 || atten < 0) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
assert(adc_unit <= ADC_UNIT_2);
|
||||
|
||||
int efuse_vol_bits = 0;
|
||||
|
Reference in New Issue
Block a user