Hello,
I am using an ADC in circular mode, and I set an AWD interrupt in order to detect when the signal has fallen below a given value. My error callback is called correctly.
What I want to do now, in the error callback, is to retrieve the index of the buffer when the interrupt occurred, i.e. to determine where was the last sample written in the buffer just before the interrupt stopped the conversion. I cannot find any information about this in the documentation.
Would this be possible in a direct manner? Otherwise do you see any workarounds?
Thank you in advance
How to retrive buffer index in ADC error callback?
- Giovanni
- Site Admin
- Posts: 14563
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1111 times
- Been thanked: 937 times
- Contact:
Re: How to retrive buffer index in ADC error callback?
Hi,
This use case is not supported by the ADC API. It would be possible to modify the driver ISR to read the DMA memory pointer value or the counter register, it has to be done just before the DMA channel is stopped.
The UART driver does something similar if I remember well.
Giovanni
This use case is not supported by the ADC API. It would be possible to modify the driver ISR to read the DMA memory pointer value or the counter register, it has to be done just before the DMA channel is stopped.
The UART driver does something similar if I remember well.
Giovanni
Who is online
Users browsing this forum: No registered users and 2 guests