stm32f205ve, Chibios v.2.5.1
I want to measure battery once per second. To save power, I want to start ADC, wait for conversion end, and then stop ADC.
Currently all works ok, but I want to stop ADC in End Conversion callback function; and, since it is called from interrupt, I have SV#4 and SV#5 when calling adcStop.
What can I do?
Thank you!
How to stop ADC from interrupt?
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: How to stop ADC from interrupt?
Hi,
You could do the following (without any callback):
adcStart()
adcConvert()
adcStop()
You need to do this from thread context, it is not possible to stop a device driver from an ISR.
Giovanni
You could do the following (without any callback):
adcStart()
adcConvert()
adcStop()
You need to do this from thread context, it is not possible to stop a device driver from an ISR.
Giovanni