fix(adc): rename ADC_ATTEN_DB_11 to ADC_ATTEN_DB_12

By design, it's 12 dB. There're errors among chips, so the actual
attenuation will be 11dB more or less
This commit is contained in:
Armando
2023-10-13 16:02:45 +08:00
parent 8768c9231c
commit d3be2541de
33 changed files with 67 additions and 66 deletions

View File

@@ -118,7 +118,7 @@ static esp_err_t cali_raw_to_voltage(void *arg, int raw, int *voltage)
static esp_err_t check_valid(const adc_cali_line_fitting_config_t *config)
{
ESP_RETURN_ON_FALSE(config->unit_id < SOC_ADC_PERIPH_NUM, ESP_ERR_INVALID_ARG, TAG, "invalid ADC unit");
ESP_RETURN_ON_FALSE((config->atten == ADC_ATTEN_DB_0 || config->atten == ADC_ATTEN_DB_11), ESP_ERR_NOT_SUPPORTED, TAG, "only ADC_ATTEN_DB_0 and ADC_ATTEN_DB_11 are supported");
ESP_RETURN_ON_FALSE((config->atten == ADC_ATTEN_DB_0 || config->atten == ADC_ATTEN_DB_12), ESP_ERR_NOT_SUPPORTED, TAG, "only ADC_ATTEN_DB_0 and ADC_ATTEN_DB_12 are supported");
if (config->atten == ADC_ATTEN_DB_0) {
ESP_LOGW(TAG, "Experimental: ADC Atten 0 calibration can now only used for inputs lower than 950mV. Calibration Scheme may get updated, DON'T USE FOR MASS PRODUCTION!");
}