Skip to content

Commit c0c6921

Browse files
committed
feat(esp_adc): option to set number of DMA buffers
Add a configuration option to set the number of DMA buffers used by adc_continuous driver
1 parent 14fbba8 commit c0c6921

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

components/esp_adc/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ menu "ADC and ADC Calibration"
9292
The SARADC clock frequency will be set to the nearest integer multiple of sample freq.
9393
The fractional divisor parameters will be calculated at runtime.
9494

95+
config ADC_CONTINUOUS_NUM_DMA
96+
int "Set the number of DMA buffers"
97+
default 5
98+
help
99+
Configure the number of DMA buffers used by adc
100+
95101
config ADC_ENABLE_DEBUG_LOG
96102
bool "Enable ADC debug log"
97103
default n

components/esp_adc/adc_continuous.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ extern portMUX_TYPE rtc_spinlock; //TODO: Will be placed in the appropriate posi
5353
#define ADC_ENTER_CRITICAL() portENTER_CRITICAL(&rtc_spinlock)
5454
#define ADC_EXIT_CRITICAL() portEXIT_CRITICAL(&rtc_spinlock)
5555

56+
#ifndef CONFIG_ADC_CONTINUOUS_NUM_DMA
5657
#define INTERNAL_BUF_NUM 5
58+
#else
59+
#define INTERNAL_BUF_NUM CONFIG_ADC_CONTINUOUS_NUM_DMA
60+
#endif
5761

5862
/*---------------------------------------------------------------
5963
ADC Continuous Read Mode (via DMA)

0 commit comments

Comments
 (0)