https://github.com/espressif/esp-idf/bl ... ple_main.c
we have a sync read of the adc value.
and therefor we loss a lot of cpu time!
Code: Select all
r = adc2_get_raw( ADC2_EXAMPLE_CHANNEL, width, &read_raw);
and then to polling or better, have a interrupt, if the conversion is done.
My research has shown there was an attempt at the "arduino-esp32" version (2017).
This has been removed in the meantime
https://github.com/espressif/arduino-esp32/issues/220
My preferred solution would be, if we had a DMA supported adc.
Automatic continues adc (with cycle time, and number of chanels, as a parameters) via DMA. Independent from the CPU.
The only CPU time we use, is , to read the memory area that was written to by the DMA.
This is realised, on STM32 CPU's since about ten years!