cancel
Showing results for 
Search instead for 
Did you mean: 

void ADC_IRQHandler(void) Question

keaven
Associate II
Posted on August 18, 2015 at 22:24

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
3 REPLIES 3
Posted on August 18, 2015 at 23:02

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jpeacock
Associate III
Posted on August 18, 2015 at 23:03

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 Peacock
keaven
Associate II
Posted on August 19, 2015 at 15:43

Thank you guys!