ARM Technical Support Knowledge Articles

INTERRUPT DEFINITION WITH ATMEL LIBRARY

Applies to: RealView C Compiler

Answer


Information in this article applies to:


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

Article last edited on: 2010-03-23 09:12:26

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential