2015-08-18 01:24 PM
I think I know the answer but I just want to be sure. Is there any way to know from which ADC the handler is called? If I am using the 3 ADCs do I need to call the HAL_ADC_IRQHandler() for all like below?
void ADC_IRQHandler(void)
{
HAL_ADC_IRQHandler(&hADC1);
HAL_ADC_IRQHandler(&hADC2);
HAL_ADC_IRQHandler(&hADC3);
}
Thank you
2015-08-18 02:02 PM
I'm sure each ADC has it's own status register flagging the source, and I'd expect the HAL handler to check this as the first order of business.
2015-08-18 02:03 PM
You can read the interrupt vector at SCB->ICSR, in the low order bits. I use it with a reentrant ADC interrupt handler to determine which converter is requesting service.
Jack Peacock2015-08-19 06:43 AM
Thank you guys!