This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

FIQ intterupt Function

I want to write function for fiq interrupt on LPC2378,
Here the program which I have try to run. But it gives error.

void T0isr(void) __fiq //__irq
{

T0IR = 1; /* clear interrupt flag */

T0TCR = 0;

Enable_Timer1();

T0TCR = 1;

VICVectAddr=0xff;
}

void Timer0_Init(int interval)
{ /*Load prescaler for 1mSec*/

T0PR=PRESCALER; /** * T0TCR: Timer 0 Control Register * 2: reset counters (both timer and prescaler) **/

T0TCR=2; /* * interrupt and clear when counter=match */

T0MCR=3; /* * interrupt every ms */

T0MR0=interval;

/** * T0TCR: Timer 0 Control Register * 1: enable counting **/

T0TCR=1;

// VICVectAddr4= (unsigned)T0isr; // Set the timer ISR address
// VICVectCntl4= 0x00000020 | 4;

VICIntSelect = 0x00000010; VICIntEnable= 0x00000010;
}

this program give error

freq.c(184): error: #130: expected a "{"

This program is running for irq but not for fiq.......
If anyone know the method of writing a fiq ...
please reply to me

Parents
  • The number in parentheses (184) tells you the line number at which the error occurred.

    As we don't have your complete file, it's impossible to tell which of the lines you posted is number 184!

    Your code is illegible because you didn't pay attention to the clear instructions for posting source code:

    www.danlhenry.com/.../keil_code.png

    Although people might give you the benefit of the doubt for sloppy errors like that, a compiler will not!

    A compiler will insist that you write your code exactly in accordance with the language syntax rules - otherwise you will get errors like this one!

    When the compiler tells you that it was expecting a '{' (an opening brace), that means that you have broken the syntax rules - eg, by missing a semicolon - and the only way the compiler could make any sense of your text was by assuming that there should have been an opening brace at the position stated.

    So you need to look at your code carefully for such mistakes!

Reply
  • The number in parentheses (184) tells you the line number at which the error occurred.

    As we don't have your complete file, it's impossible to tell which of the lines you posted is number 184!

    Your code is illegible because you didn't pay attention to the clear instructions for posting source code:

    www.danlhenry.com/.../keil_code.png

    Although people might give you the benefit of the doubt for sloppy errors like that, a compiler will not!

    A compiler will insist that you write your code exactly in accordance with the language syntax rules - otherwise you will get errors like this one!

    When the compiler tells you that it was expecting a '{' (an opening brace), that means that you have broken the syntax rules - eg, by missing a semicolon - and the only way the compiler could make any sense of your text was by assuming that there should have been an opening brace at the position stated.

    So you need to look at your code carefully for such mistakes!

Children