Boa tarde,
Preciso fazer uma fast interrupt mas eu não sei aonde estou errando.
Inclusive achei um código pronto e ele não acusa erro, mas quando faço a mesma coisa no meu, acusa: expected a "{". (logo depois da declaração __fiq)
Agora eu não sei se tem que alterar alguma coisa no startup.s ou modificar o modo Thumb ou Asm, etc...
Ps: estou utilizando o MDK-Arm
O código pronto que eu tenho segue abaixo:
#include <LPC21xx.H>
void fiqint (void) ; //declare FIQ ISR
void initFiq (void);
void main (void)
{
initFiq(); //Initilise the Fast interrupt source
while(1)
{
IOCLR1 = 0x00FF0000; //Loop here forever
}
}
void fiqint (void) __fiq
{
IOSET1 = 0x00FF0000; //Set the LED pins
EXTINT = 0x00000002; //Clear the peripheral interrupt flag
}
void initFiq(void)
{
IODIR1 = 0x00FF0000; //Set the LED pins as outputs
PINSEL0 = 0x20000000; //Enable the EXTINT1 interrupt
VICIntSelect = 0x00008000; //Enable a Vic Channel as FIQ
VICIntEnable = 0x00008000;
}
O meu código ficou assim (resumidamente):
#include <LPC213x.h> //Lpc2138 definitions
#include "Constantes.h"
void InitSystem(void);
void InitPorts (void);
void I2CISR (void); //I2C interrupt routine
.
.
.
void InitVectors(void)
{
INTWAKE = 0x00; //All external interrupts to wake up the processor are disable
EXTMODE = 0x00; //All external interrupts are level sensitive
EXTPOLAR = 0x00; //All external interrupts are low level active
VICVectAddr0 = (unsigned)T1isr; //Set the timer ISR vector address
VICVectCntl0 = 0x00000025; //Set channel
VICVectAddr1 = (unsigned)I2CISR; //pass the address of the IRQ into the VIC slot
VICVectCntl1 = 0x00000029; //select a priority slot for a given interrupt
VICVectAddr2 = (unsigned)MM_UART1_ISR; //Set the timer ISR vector address
VICVectCntl2 = 0x00000027; //Set channel
VICVectAddr3 = (unsigned)T0isr; //Set the timer ISR vector address
VICVectCntl3 = 0x00000024; //Set channel
VICVectAddr4 = (unsigned)MM_UART0_ISR; //Set the timer ISR vector address
VICVectCntl4 = 0x00000026; //Set channel
VICVectAddr5 = (unsigned int) &EINT2_ISR;
EXTINT = 0x04; // Clear the peripheral interrupt flag
VICVectCntl5 = 0x30; // Channel1 on Source#16 ... enabled
VICIntSelect = 0x00000200;
VICIntEnable = CteEnableAllInt; //Enable the interrupt
}//void InitVectors(void)
.
.
.
void I2CISR (void) __fiq<- acusa erro aqui
{
switch (CtrI2C)
{
case(0): //Controla o LM75A
switch (I2C0STAT) //Read result code and switch to next action
{
.
.
.
Por acaso alguem saberia o que pode ser?