Forráskód Böngészése

ci(adc): print adc efuse calib version in test

laokaiyao 2 éve
szülő
commit
464bec8ac6

+ 1 - 1
components/esp_adc/test_apps/adc/main/CMakeLists.txt

@@ -9,5 +9,5 @@ set(srcs "test_app_main.c"
 # In order for the cases defined by `TEST_CASE` to be linked into the final elf,
 # the component can be registered as WHOLE_ARCHIVE
 idf_component_register(SRCS ${srcs}
-                       PRIV_REQUIRES driver esp_wifi nvs_flash esp_adc test_utils
+                       PRIV_REQUIRES driver esp_wifi nvs_flash esp_adc test_utils efuse
                        WHOLE_ARCHIVE)

+ 12 - 0
components/esp_adc/test_apps/adc/main/test_app_main.c

@@ -7,6 +7,16 @@
 #include "unity.h"
 #include "unity_test_utils.h"
 #include "esp_heap_caps.h"
+#include "soc/soc_caps.h"
+#include "sdkconfig.h"
+#if CONFIG_IDF_TARGET_ESP32S2
+#include "esp_efuse_rtc_table.h"
+#define esp_efuse_rtc_calib_get_ver()     esp_efuse_rtc_table_read_calib_version()
+#elif SOC_ADC_CALIBRATION_V1_SUPPORTED
+#include "esp_efuse_rtc_calib.h"
+#else
+#define esp_efuse_rtc_calib_get_ver()     -1        // Not support calibration
+#endif
 
 #define TEST_MEMORY_LEAK_THRESHOLD (600)
 
@@ -33,5 +43,7 @@ void app_main(void)
     printf("  | |/ _ \\/ __| __|   / _ \\ | | | | |    \n");
     printf("  | |  __/\\__ \\ |_   / ___ \\| |_| | |___ \n");
     printf("  |_|\\___||___/\\__| /_/   \\_\\____/ \\____|\n");
+
+    printf("\nADC eFuse Calibration Version %d\n", esp_efuse_rtc_calib_get_ver());
     unity_run_menu();
 }

+ 1 - 1
components/hal/esp32h2/include/hal/ana_cmpr_ll.h

@@ -49,7 +49,7 @@ static inline void analog_cmpr_ll_set_internal_ref_voltage(analog_cmpr_dev_t *hw
  */
 static inline uint32_t analog_cmpr_ll_get_internal_ref_voltage(analog_cmpr_dev_t *hw)
 {
-    return hw->pad_comp_config.dref_comp;
+    return hw->pad_comp_config->dref_comp;
 }
 
 /**