forked from espressif/esp-idf
driver: adc: use SOC_ADC_PERIPH_NUM for array size
ADC_UNIT_MAX is no longer equal to the number of ADC units. This makes the static s_adc_cali_param arrays larger than necessary.
This commit is contained in:
@@ -232,7 +232,7 @@ esp_err_t adc2_pad_get_io_num(adc2_channel_t channel, gpio_num_t *gpio_num)
|
|||||||
* adc_common.c is far too confusing. Before a refactor is applied to adc_common.c, will put definite code in driver/adc.c
|
* adc_common.c is far too confusing. Before a refactor is applied to adc_common.c, will put definite code in driver/adc.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static uint16_t s_adc_cali_param[ADC_UNIT_MAX][ADC_ATTEN_MAX] = {};
|
static uint16_t s_adc_cali_param[SOC_ADC_PERIPH_NUM][ADC_ATTEN_MAX] = {};
|
||||||
|
|
||||||
uint32_t adc_get_calibration_offset(adc_ll_num_t adc_n, adc_channel_t channel, adc_atten_t atten)
|
uint32_t adc_get_calibration_offset(adc_ll_num_t adc_n, adc_channel_t channel, adc_atten_t atten)
|
||||||
{
|
{
|
||||||
|
@@ -666,7 +666,7 @@ esp_err_t adc_digi_monitor_enable(adc_digi_monitor_idx_t idx, bool enable)
|
|||||||
RTC controller setting
|
RTC controller setting
|
||||||
---------------------------------------------------------------*/
|
---------------------------------------------------------------*/
|
||||||
|
|
||||||
static uint16_t s_adc_cali_param[ADC_UNIT_MAX][ADC_ATTEN_MAX] = {};
|
static uint16_t s_adc_cali_param[SOC_ADC_PERIPH_NUM][ADC_ATTEN_MAX] = {};
|
||||||
|
|
||||||
//NOTE: according to calibration version, different types of lock may be taken during the process:
|
//NOTE: according to calibration version, different types of lock may be taken during the process:
|
||||||
// 1. Semaphore when reading efuse
|
// 1. Semaphore when reading efuse
|
||||||
|
@@ -663,7 +663,7 @@ esp_err_t adc_digi_monitor_enable(adc_digi_monitor_idx_t idx, bool enable)
|
|||||||
RTC controller setting
|
RTC controller setting
|
||||||
---------------------------------------------------------------*/
|
---------------------------------------------------------------*/
|
||||||
|
|
||||||
static uint16_t s_adc_cali_param[ADC_UNIT_MAX][ADC_ATTEN_MAX] = {};
|
static uint16_t s_adc_cali_param[SOC_ADC_PERIPH_NUM][ADC_ATTEN_MAX] = {};
|
||||||
|
|
||||||
//NOTE: according to calibration version, different types of lock may be taken during the process:
|
//NOTE: according to calibration version, different types of lock may be taken during the process:
|
||||||
// 1. Semaphore when reading efuse
|
// 1. Semaphore when reading efuse
|
||||||
|
Reference in New Issue
Block a user