Merge branch 'bugfix/adc_outof_bound_read_v5.0' into 'release/v5.0'

adc: fix out of bound read

See merge request espressif/esp-idf!24170
This commit is contained in:
morris 2023-06-13 10:05:39 +08:00
commit e37618cda7

View File

@ -104,7 +104,7 @@ static void adc_dma_intr_handler(void *arg);
static int8_t adc_digi_get_io_num(adc_unit_t adc_unit, uint8_t adc_channel)
{
assert(adc_unit <= SOC_ADC_PERIPH_NUM);
assert(adc_unit < SOC_ADC_PERIPH_NUM);
uint8_t adc_n = (adc_unit == ADC_UNIT_1) ? 0 : 1;
return adc_channel_io_map[adc_n][adc_channel];
}