Skip to content

Commit

Permalink
feat(esp_adc):option to set number of DMA buffers
Browse files Browse the repository at this point in the history
Add a configuration option to set the number of DMA buffers used by
adc_continuous driver
  • Loading branch information
mcapdeville committed Dec 26, 2024
1 parent f3e1606 commit 722c306
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/esp_adc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ menu "ADC and ADC Calibration"
The SARADC clock frequency will be set to the nearest integer multiple of sample freq.
The fractional divisor parameters will be calculated at runtime.

config ADC_CONTINUOUS_NUM_DMA
int "Set the number of DMA buffers"
default 5
help
Configure the number of DMA buffers used by adc

config ADC_ENABLE_DEBUG_LOG
bool "Enable ADC debug log"
default n
Expand Down
5 changes: 5 additions & 0 deletions components/esp_adc/adc_continuous.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ extern portMUX_TYPE rtc_spinlock; //TODO: Will be placed in the appropriate posi
#define ADC_ENTER_CRITICAL() portENTER_CRITICAL(&rtc_spinlock)
#define ADC_EXIT_CRITICAL() portEXIT_CRITICAL(&rtc_spinlock)

#ifndef CONFIG_ADC_CONTINUOUS_NUM_DMA
#define INTERNAL_BUF_NUM 5
#else
#define INTERNAL_BUF_NUM CONFIG_ADC_CONTINUOUS_NUM_DMA
#endif


/*---------------------------------------------------------------
ADC Continuous Read Mode (via DMA)
Expand Down

0 comments on commit 722c306

Please sign in to comment.