2017-01-05 06:20 AM
In my project (F415RG) I'm running timer paced single channel ADC sampling with DMA transfers and Analog Watchdog coupled to the same ADC channel. When an out of window voltage occur I need to momentarily stop the ADC in the associated callback function but I'm not clear on if calling HAL_ADC_Stop_DMA() is instantaneous or if it keeps sampling until current buffer is Transfer Complete? I guess some extra samples after a halt is requested are unavoidable due to its CPU independent operation but are there any hard or approximate figures on how much this will be?
While I'm at it, a vaguely related question; Should global variables in any HAL_ADC_...() callback functions be declared volatile?