Page 1 of 1

Retrieve position in buffer in ADC error callback function

Posted: Tue Mar 08, 2022 10:35 am
by maxpav
Hello,

I am running an ADC in circular mode, and I am using the analog watchdog interrupt. Is it possible to retrieve the position of the last filled sample in the buffer from within the adcerrorcallback function (interrupt routine), when the voltage has fallen outside of the specified range? If yes - how?
My project runs on a NucleoF411Re board.

Thank you,
Maxim

Re: Retrieve position in buffer in ADC error callback function

Posted: Tue Mar 08, 2022 12:36 pm
by Giovanni
Hi,

Look at examples, you need to verify the driver state, if the state is ADC_COMPLETE then the 2nd half of the buffer has been filled, else it is the 1st half.

Giovanni