This will decrease the flash size and should increase performance.
In some cases this will increase the used ram slightly.
In total this path costs 28 bytes RAM and saves 88 bytes of Flash on a STM32.
AVRs are not affected by this commit.
Was a little bit tricky. When using ADC with DMA and infitiy readings, everthing is ok. But we don't need so much readings.
To read only one shot after starting the ADC, we need something more.
Disabling continuous conversion and unset the DMA bit. So conversion is stopped. Else the next conversion could start at any ADC.
For a restart just enable again the DMA bit, the continuous conversion and start the ADC.
Eureka!!!
The STM32 has only one data register for all channels. So I want to use the ADC over DMA.
Issues are: It is not possible to stop the DMA or the ADC without uninit and init the hole parts.
We have more or less one option. Manually start the ADC.
So what we have now. We start the ADC after reading the values from DMA buffer. The ADC now make a conversion of all channels.
We can read also the values because it uses a double buffer mode. With that mode we can read the unused buffer.