Keil™, An ARM® Company

Technical Support

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);

Last Reviewed: Friday, February 02, 2007


Did this article provide the answer you needed?
 
Yes
No
Not Sure