ADC adc_continuous_read() return values

Cages123
Posts: 2
Joined: Tue Jan 09, 2024 12:36 pm

ADC adc_continuous_read() return values

Postby Cages123 » Mon Feb 12, 2024 11:07 am

Hi,
by modifying the continuous read example I can get adc_continous_read() to return ESP_OK and ESP_ERR_TIMEOUT.
Cannot get ESP_ERR_INVALID_STATE even when I call adc_continous_read() every 2seconds
with a sample frequency of 20Khz (.sample_freq_hz = 20 * 1000).

Reading the documentation I assumed if the task missed data by not calling adc_continous_read() at a suitable frequency ESP_ERR_INVALID_STATE would be returned.

Is there anyway by pooling to detect generated results were lost.

Section of the documentation I am referring to:
If the generated results fill up the internal pool, new generated results will be lost. Next time when the adc_continuous_read() is called, this function will return ESP_ERR_INVALID_STATE indicating this situation.

Who is online

Users browsing this forum: Baidu [Spider], Majestic-12 [Bot] and 117 guests