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

Fixed typo for adc_continuous_data typedef in esp32-hal-adc.h/.c #9529

Merged
merged 3 commits into from
Apr 19, 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
6 changes: 3 additions & 3 deletions cores/esp32/esp32-hal-adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ static uint8_t __adcContinuousAtten = ADC_11db;
static uint8_t __adcContinuousWidth = SOC_ADC_DIGI_MAX_BITWIDTH;

static uint8_t used_adc_channels = 0;
adc_continuos_data_t *adc_result = NULL;
adc_continuous_data_t *adc_result = NULL;

static bool adcContinuousDetachBus(void *adc_unit_number) {
adc_unit_t adc_unit = (adc_unit_t)adc_unit_number - 1;
Expand Down Expand Up @@ -537,7 +537,7 @@ bool analogContinuous(uint8_t pins[], size_t pins_count, uint32_t conversions_pe
}

//Allocate and prepare result structure for adc readings
adc_result = malloc(pins_count * sizeof(adc_continuos_data_t));
adc_result = malloc(pins_count * sizeof(adc_continuous_data_t));
for (int k = 0; k < pins_count; k++) {
adc_result[k].pin = pins[k];
adc_result[k].channel = channel[k];
Expand Down Expand Up @@ -578,7 +578,7 @@ bool analogContinuous(uint8_t pins[], size_t pins_count, uint32_t conversions_pe
return true;
}

bool analogContinuousRead(adc_continuos_data_t **buffer, uint32_t timeout_ms) {
bool analogContinuousRead(adc_continuous_data_t **buffer, uint32_t timeout_ms) {
if (adc_handle[ADC_UNIT_1].adc_continuous_handle != NULL) {
uint32_t bytes_read = 0;
uint32_t read_raw[used_adc_channels];
Expand Down
4 changes: 2 additions & 2 deletions cores/esp32/esp32-hal-adc.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ extern "C" {
uint8_t channel; /*!<ADC channel */
int avg_read_raw; /*!<ADC average raw data */
int avg_read_mvolts; /*!<ADC average voltage in mV */
} adc_continuos_data_t;
} adc_continuous_data_t;

/*
* Setup ADC continuous peripheral
Expand All @@ -96,7 +96,7 @@ extern "C" {
/*
* Read ADC continuous conversion data
* */
bool analogContinuousRead(adc_continuos_data_t** buffer, uint32_t timeout_ms);
bool analogContinuousRead(adc_continuous_data_t** buffer, uint32_t timeout_ms);

/*
* Start ADC continuous conversions
Expand Down
8 changes: 4 additions & 4 deletions docs/en/api/adc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ If ``false`` is returned, error occurs and ADC continuous was not configured.
analogContinuousRead
^^^^^^^^^^^^^^^^^^^^

This function is used to read ADC continuous data to the result buffer. The result buffer is an array of ``adc_continuos_data_t``.
This function is used to read ADC continuous data to the result buffer. The result buffer is an array of ``adc_continuous_data_t``.

.. code-block:: arduino

Expand All @@ -193,13 +193,13 @@ This function is used to read ADC continuous data to the result buffer. The resu
uint8_t channel; /*!<ADC channel */
int avg_read_raw; /*!<ADC average raw data */
int avg_read_mvolts; /*!<ADC average voltage in mV */
} adc_continuos_data_t;
} adc_continuous_data_t;

.. code-block:: arduino

bool analogContinuousRead(adc_continuos_data_t ** buffer, uint32_t timeout_ms);
bool analogContinuousRead(adc_continuous_data_t ** buffer, uint32_t timeout_ms);

* ``buffer`` conversion result buffer to read from ADC in adc_continuos_data_t format.
* ``buffer`` conversion result buffer to read from ADC in adc_continuous_data_t format.
* ``timeout_ms`` time to wait for data in milliseconds.

This function will return ``true`` if reading is successful and ``buffer`` is filled with data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ uint8_t adc_pins_count = sizeof(adc_pins) / sizeof(uint8_t);
volatile bool adc_coversion_done = false;

// Result structure for ADC Continuous reading
adc_continuos_data_t* result = NULL;
adc_continuous_data_t* result = NULL;

// ISR Function that will be triggered when ADC conversion is done
void ARDUINO_ISR_ATTR adcComplete() {
Expand Down
2 changes: 1 addition & 1 deletion tests/periman/periman.ino
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void adc_continuous_test(void) {
test_executed = true;
uint8_t adc_pins[] = { ADC1_DEFAULT, ADC2_DEFAULT };
uint8_t adc_pins_count = 2;
adc_continuos_data_t* result = NULL;
adc_continuous_data_t* result = NULL;

analogContinuousSetWidth(12);
analogContinuousSetAtten(ADC_11db);
Expand Down
Loading