Skip to content

Commit

Permalink
Merge branch 'bugfix/fix_adc_cali_error_after_light_sleep_wake_on_h2'…
Browse files Browse the repository at this point in the history
… into 'master'

adc: fix calibration error when waking up from light sleep on H2 and enable test

Closes IDF-8569

See merge request espressif/esp-idf!27242
  • Loading branch information
Bruce297 committed Nov 24, 2023
2 parents f4c7dfd + 4f81883 commit b9a3dd1
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions components/esp_adc/test_apps/adc/main/test_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,14 @@ static void s_adc_oneshot_with_sleep(adc_unit_t unit_id, adc_channel_t channel)
#define ADC2_SLEEP_TEST_CHAN ADC_CHANNEL_0
#endif

TEST_CASE("test ADC1 Single Read with Light Sleep", "[adc][manul][ignore]")
TEST_CASE("test ADC1 Single Read with Light Sleep", "[adc]")
{
s_adc_oneshot_with_sleep(ADC_UNIT_1, ADC1_SLEEP_TEST_CHAN);
}

#if (SOC_ADC_PERIPH_NUM >= 2) && !CONFIG_IDF_TARGET_ESP32C3
//ESP32C3 ADC2 oneshot mode is not supported anymore
TEST_CASE("test ADC2 Single Read with Light Sleep", "[adc][manul][ignore]")
TEST_CASE("test ADC2 Single Read with Light Sleep", "[adc]")
{
s_adc_oneshot_with_sleep(ADC_UNIT_2, ADC2_SLEEP_TEST_CHAN);
}
Expand Down
2 changes: 1 addition & 1 deletion components/soc/esp32c2/include/soc/regi2c_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

/**
* Restore regi2c analog calibration related configuration registers.
* This is a workaround, and is fixed on later chips
* This is a workaround for calibration error when waking up from light sleep
*/
#define REGI2C_ANA_CALI_PD_WORKAROUND 1
#define REGI2C_ANA_CALI_BYTE_NUM 8
2 changes: 1 addition & 1 deletion components/soc/esp32c3/include/soc/regi2c_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

/**
* Restore regi2c analog calibration related configuration registers.
* This is a workaround, and is fixed on later chips
* This is a workaround for calibration error when waking up from light sleep
*/
#define REGI2C_ANA_CALI_PD_WORKAROUND 1
#define REGI2C_ANA_CALI_BYTE_NUM 8
7 changes: 7 additions & 0 deletions components/soc/esp32h2/include/soc/regi2c_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@
#define ANA_CONFIG2_M BIT(18)

#define ANA_I2C_SAR_FORCE_PU BIT(16)

/**
* Restore regi2c analog calibration related configuration registers.
* This is a workaround for calibration error when waking up from light sleep
*/
#define REGI2C_ANA_CALI_PD_WORKAROUND 1
#define REGI2C_ANA_CALI_BYTE_NUM 8
2 changes: 1 addition & 1 deletion components/soc/esp32s2/include/soc/regi2c_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

/**
* Restore regi2c analog calibration related configuration registers.
* This is a workaround, and is fixed on later chips
* This is a workaround for calibration error when waking up from light sleep
*/
#define REGI2C_ANA_CALI_PD_WORKAROUND 1
#define REGI2C_ANA_CALI_BYTE_NUM 8
4 changes: 2 additions & 2 deletions components/soc/esp32s3/include/soc/regi2c_defs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -27,7 +27,7 @@

/**
* Restore regi2c analog calibration related configuration registers.
* This is a workaround, and is fixed on later chips
* This is a workaround for calibration error when waking up from light sleep
*/
#define REGI2C_ANA_CALI_PD_WORKAROUND 1
#define REGI2C_ANA_CALI_BYTE_NUM 8

0 comments on commit b9a3dd1

Please sign in to comment.