Keil Logo

ARMCC: INTERRUPT DEFINITION WITH ATMEL LIBRARY


Information in this article applies to:

  • RealView C Compiler Version 3

QUESTION

I am using the Atmel library and I have defined a simple interrupt function with:

__irq void isr_function(void) {
  :
}

I now enable the interrupt function with:

  AT91F_AIC_ConfigureIt (pAIC,AT91C_ID_PIOA,AT91C_AIC_PRIOR_HIGHEST,AT91C_AIC_SRCTYPE_HIGH_LEVEL,  isr_function);

But I am getting the following compiler error:

error: #167: argument of type "void (*)(void)__irq" is incompatible with parameter of type "void (*)()"

What can be the reason?

ANSWER

The RealView compiler does very strict type-checking and you need therefore to insert a type cast:

  AT91F_AIC_ConfigureIt (pAIC,AT91C_ID_PIOA,AT91C_AIC_PRIOR_HIGHEST,AT91C_AIC_SRCTYPE_HIGH_LEVEL, (void (*)()) isr_function);

SEE ALSO

Last Reviewed: Tuesday, March 23, 2010


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.