Unverified Commit b2e67ca2 authored by Marek Knosala's avatar Marek Knosala Committed by GitHub

Update analogContinuous function for passing pins as const and constexpr (#10044)

* Update esp32-hal-adc.c

* Update esp32-hal-adc.h

* Update adc.rst
parent 690bdb51
...@@ -456,7 +456,7 @@ esp_err_t __analogContinuousInit(adc_channel_t *channel, uint8_t channel_num, ad ...@@ -456,7 +456,7 @@ esp_err_t __analogContinuousInit(adc_channel_t *channel, uint8_t channel_num, ad
return ESP_OK; return ESP_OK;
} }
bool analogContinuous(uint8_t pins[], size_t pins_count, uint32_t conversions_per_pin, uint32_t sampling_freq_hz, void (*userFunc)(void)) { bool analogContinuous(const uint8_t pins[], size_t pins_count, uint32_t conversions_per_pin, uint32_t sampling_freq_hz, void (*userFunc)(void)) {
adc_channel_t channel[pins_count]; adc_channel_t channel[pins_count];
adc_unit_t adc_unit = ADC_UNIT_1; adc_unit_t adc_unit = ADC_UNIT_1;
esp_err_t err = ESP_OK; esp_err_t err = ESP_OK;
......
...@@ -91,7 +91,7 @@ typedef struct { ...@@ -91,7 +91,7 @@ typedef struct {
/* /*
* Setup ADC continuous peripheral * Setup ADC continuous peripheral
* */ * */
bool analogContinuous(uint8_t pins[], size_t pins_count, uint32_t conversions_per_pin, uint32_t sampling_freq_hz, void (*userFunc)(void)); bool analogContinuous(const uint8_t pins[], size_t pins_count, uint32_t conversions_per_pin, uint32_t sampling_freq_hz, void (*userFunc)(void));
/* /*
* Read ADC continuous conversion data * Read ADC continuous conversion data
......
...@@ -170,7 +170,7 @@ This function is used to configure ADC continuous peripheral on selected pins. ...@@ -170,7 +170,7 @@ This function is used to configure ADC continuous peripheral on selected pins.
.. code-block:: arduino .. code-block:: arduino
bool analogContinuous(uint8_t pins[], size_t pins_count, uint32_t conversions_per_pin, uint32_t sampling_freq_hz, void (*userFunc)(void)); bool analogContinuous(const uint8_t pins[], size_t pins_count, uint32_t conversions_per_pin, uint32_t sampling_freq_hz, void (*userFunc)(void));
* ``pins[]`` array of pins to be set up * ``pins[]`` array of pins to be set up
* ``pins_count`` count of pins in array * ``pins_count`` count of pins in array
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment