Using HAL_Delay inside the DMA callback
Hi everyone, I'm new to MCUs and programming in general and currently trying to calculate the average of the plateaus from 3 ADC input channels. I'm using Exponential Smoothing to reduce the noise and an algorithm to detect the plateau. Even tho my signals are similar, there's a slight shift and that's always less than 3ms.
My goal is to run the algorithm for only one channel and when it detects a plateau, it'd wait 3ms before it starts averaging for all the channels. Averaging would stop after some ms. I'm using HAL_Delay and HAL_GetTick for this purpose but it looks like I get different values than reality.
The noise reduction and averaging algorithm work for single-channel. There could be smarter ways to do this but I don't have much experience with this.
I'm looking for advice on this whole process.
