mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-03 20:54:32 +02:00
adc: esp32s2: fix unit to offset calculation
adc2 eFuse offset is wrong on 4.4 to 5.0 transition Closes https://github.com/espressif/esp-idf/issues/9705 Closes https://github.com/espressif/esp-idf/pull/9715
This commit is contained in:
@@ -97,6 +97,7 @@ int esp_efuse_rtc_table_read_calib_version(void)
|
|||||||
|
|
||||||
int esp_efuse_rtc_table_get_tag(int version, int adc_num, int atten, int extra_params)
|
int esp_efuse_rtc_table_get_tag(int version, int adc_num, int atten, int extra_params)
|
||||||
{
|
{
|
||||||
|
assert(adc_num <= ADC_UNIT_2);
|
||||||
int index = (adc_num == ADC_UNIT_1) ? 0 : 1;
|
int index = (adc_num == ADC_UNIT_1) ? 0 : 1;
|
||||||
int param_offset; // used to index which (adc_num, atten) array to use.
|
int param_offset; // used to index which (adc_num, atten) array to use.
|
||||||
if (version == 1 && extra_params == RTCCALIB_V1_PARAM_VLOW) { // Volage LOW, Version 1
|
if (version == 1 && extra_params == RTCCALIB_V1_PARAM_VLOW) { // Volage LOW, Version 1
|
||||||
|
@@ -97,7 +97,7 @@ void adc_power_release(void)
|
|||||||
|
|
||||||
static inline uint32_t esp_efuse_rtc_calib_get_init_code(int version, uint32_t adc_unit, int atten)
|
static inline uint32_t esp_efuse_rtc_calib_get_init_code(int version, uint32_t adc_unit, int atten)
|
||||||
{
|
{
|
||||||
int tag = esp_efuse_rtc_table_get_tag(version, adc_unit + 1, atten, RTCCALIB_V2_PARAM_VINIT);
|
int tag = esp_efuse_rtc_table_get_tag(version, adc_unit, atten, RTCCALIB_V2_PARAM_VINIT);
|
||||||
return esp_efuse_rtc_table_get_parsed_efuse_value(tag, false);
|
return esp_efuse_rtc_table_get_parsed_efuse_value(tag, false);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user