Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cores/esp32/esp32-hal-adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ esp_err_t __analogContinuousInit(adc_channel_t *channel, uint8_t channel_num, ad
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_unit_t adc_unit = ADC_UNIT_1;
esp_err_t err = ESP_OK;
Expand Down
2 changes: 1 addition & 1 deletion cores/esp32/esp32-hal-adc.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ typedef struct {
/*
* 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
Expand Down
2 changes: 1 addition & 1 deletion docs/en/api/adc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ This function is used to configure ADC continuous peripheral on selected pins.

.. 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_count`` count of pins in array
Expand Down
Loading