Unverified Commit 6b3a9a9b authored by Darkl0ud's avatar Darkl0ud Committed by GitHub

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

* Fixed typo in adc_continuous_data typedef

Fixed typo in adc_continuous_data typedef

* Additional typo fix for adc_continuous_data typedef

Additional commit for previous commit (#9529) adding typo corrections within

1. /docs/en/api/adc.rst
2. /libraries/ESP32/examples/AnalogReadContinuous\AnalogReadContinuous.ino
3. tests/periman/periman.ino

---------
Co-authored-by: default avatarLucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
parent 4070a879
...@@ -360,7 +360,7 @@ static uint8_t __adcContinuousAtten = ADC_11db; ...@@ -360,7 +360,7 @@ static uint8_t __adcContinuousAtten = ADC_11db;
static uint8_t __adcContinuousWidth = SOC_ADC_DIGI_MAX_BITWIDTH; static uint8_t __adcContinuousWidth = SOC_ADC_DIGI_MAX_BITWIDTH;
static uint8_t used_adc_channels = 0; 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) { static bool adcContinuousDetachBus(void *adc_unit_number) {
adc_unit_t adc_unit = (adc_unit_t)adc_unit_number - 1; adc_unit_t adc_unit = (adc_unit_t)adc_unit_number - 1;
...@@ -537,7 +537,7 @@ bool analogContinuous(uint8_t pins[], size_t pins_count, uint32_t conversions_pe ...@@ -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 //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++) { for (int k = 0; k < pins_count; k++) {
adc_result[k].pin = pins[k]; adc_result[k].pin = pins[k];
adc_result[k].channel = channel[k]; adc_result[k].channel = channel[k];
...@@ -578,7 +578,7 @@ bool analogContinuous(uint8_t pins[], size_t pins_count, uint32_t conversions_pe ...@@ -578,7 +578,7 @@ bool analogContinuous(uint8_t pins[], size_t pins_count, uint32_t conversions_pe
return true; 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) { if (adc_handle[ADC_UNIT_1].adc_continuous_handle != NULL) {
uint32_t bytes_read = 0; uint32_t bytes_read = 0;
uint32_t read_raw[used_adc_channels]; uint32_t read_raw[used_adc_channels];
......
...@@ -86,7 +86,7 @@ extern "C" { ...@@ -86,7 +86,7 @@ extern "C" {
uint8_t channel; /*!<ADC channel */ uint8_t channel; /*!<ADC channel */
int avg_read_raw; /*!<ADC average raw data */ int avg_read_raw; /*!<ADC average raw data */
int avg_read_mvolts; /*!<ADC average voltage in mV */ int avg_read_mvolts; /*!<ADC average voltage in mV */
} adc_continuos_data_t; } adc_continuous_data_t;
/* /*
* Setup ADC continuous peripheral * Setup ADC continuous peripheral
...@@ -96,7 +96,7 @@ extern "C" { ...@@ -96,7 +96,7 @@ extern "C" {
/* /*
* Read ADC continuous conversion data * 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 * Start ADC continuous conversions
......
...@@ -184,7 +184,7 @@ If ``false`` is returned, error occurs and ADC continuous was not configured. ...@@ -184,7 +184,7 @@ If ``false`` is returned, error occurs and ADC continuous was not configured.
analogContinuousRead 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 .. code-block:: arduino
...@@ -193,13 +193,13 @@ This function is used to read ADC continuous data to the result buffer. The resu ...@@ -193,13 +193,13 @@ This function is used to read ADC continuous data to the result buffer. The resu
uint8_t channel; /*!<ADC channel */ uint8_t channel; /*!<ADC channel */
int avg_read_raw; /*!<ADC average raw data */ int avg_read_raw; /*!<ADC average raw data */
int avg_read_mvolts; /*!<ADC average voltage in mV */ int avg_read_mvolts; /*!<ADC average voltage in mV */
} adc_continuos_data_t; } adc_continuous_data_t;
.. code-block:: arduino .. 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. * ``timeout_ms`` time to wait for data in milliseconds.
This function will return ``true`` if reading is successful and ``buffer`` is filled with data. This function will return ``true`` if reading is successful and ``buffer`` is filled with data.
......
...@@ -16,7 +16,7 @@ uint8_t adc_pins_count = sizeof(adc_pins) / sizeof(uint8_t); ...@@ -16,7 +16,7 @@ uint8_t adc_pins_count = sizeof(adc_pins) / sizeof(uint8_t);
volatile bool adc_coversion_done = false; volatile bool adc_coversion_done = false;
// Result structure for ADC Continuous reading // 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 // ISR Function that will be triggered when ADC conversion is done
void ARDUINO_ISR_ATTR adcComplete() { void ARDUINO_ISR_ATTR adcComplete() {
......
...@@ -158,7 +158,7 @@ void adc_continuous_test(void) { ...@@ -158,7 +158,7 @@ void adc_continuous_test(void) {
test_executed = true; test_executed = true;
uint8_t adc_pins[] = { ADC1_DEFAULT, ADC2_DEFAULT }; uint8_t adc_pins[] = { ADC1_DEFAULT, ADC2_DEFAULT };
uint8_t adc_pins_count = 2; uint8_t adc_pins_count = 2;
adc_continuos_data_t* result = NULL; adc_continuous_data_t* result = NULL;
analogContinuousSetWidth(12); analogContinuousSetWidth(12);
analogContinuousSetAtten(ADC_11db); analogContinuousSetAtten(ADC_11db);
......
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