forked from espressif/esp-idf
adc_cali: fix the condition of ocode calibration
This commit is contained in:
@@ -19,10 +19,8 @@
|
|||||||
|
|
||||||
int esp_efuse_rtc_calib_get_ver(void)
|
int esp_efuse_rtc_calib_get_ver(void)
|
||||||
{
|
{
|
||||||
uint32_t blk_ver = efuse_hal_blk_version();
|
|
||||||
|
|
||||||
uint32_t cali_version = 0;
|
uint32_t cali_version = 0;
|
||||||
if (blk_ver > 0) {
|
if (efuse_hal_blk_version() >= 1) {
|
||||||
cali_version = ESP_EFUSE_ADC_CALIB_VER;
|
cali_version = ESP_EFUSE_ADC_CALIB_VER;
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGW("eFuse", "calibration efuse version does not match, set default version to 0");
|
ESP_LOGW("eFuse", "calibration efuse version does not match, set default version to 0");
|
||||||
|
@@ -78,20 +78,8 @@ static void calibrate_ocode(void)
|
|||||||
|
|
||||||
void esp_ocode_calib_init(void)
|
void esp_ocode_calib_init(void)
|
||||||
{
|
{
|
||||||
bool ignore_major = efuse_ll_get_disable_blk_version_major();
|
if (efuse_hal_blk_version() >= 1) {
|
||||||
uint32_t blk_version = efuse_hal_blk_version();
|
set_ocode_by_efuse(1);
|
||||||
|
|
||||||
uint8_t ocode_scheme_ver = 0;
|
|
||||||
if(blk_version == 0 && !ignore_major) {
|
|
||||||
ESP_HW_LOGE(TAG, "Invalid blk_version\n");
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
if(blk_version > 0) {
|
|
||||||
ocode_scheme_ver = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ocode_scheme_ver == 1) {
|
|
||||||
set_ocode_by_efuse(ocode_scheme_ver);
|
|
||||||
} else {
|
} else {
|
||||||
calibrate_ocode();
|
calibrate_ocode();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user