STM32 - Analogread

Thanks !!!

Yesterday evening on the same board I noticed some glitches from times to time on the current sensing:

That could be one reason for the vibrations, it’s not happening without analogread. I need to check what is happening.

I measured analogread takes around 15us instead of 65us before depending on what channel is sampled. It’s much better but still too slow for sampling a single channel, so it should really be used for non frequent sampling, not running each loop but every 10 loop or more.

Long term solution is to create an adc class that can sample more than one channel and replace analogread for simplefoc, I started to look at how to implement it.

[EDIT] ah you are downsampling already :+1: