I changed the asmfunc.S and use a FIQ interruption, but only enter the
procedure one time. I clean the flags of interruption but still don't
work;
I changed in the code:
.section .VECTOR, "ax"
.arm
LDR PC, [PC, #24] @ Reset entry, jump to reset handler
LDR PC, [PC, #24] @ Undef entry, trap
LDR PC, [PC, #24] @ SWI entry, jump to SWI handler
LDR PC, [PC, #24] @ PAbt entry, trap
LDR PC, [PC, #24] @ DAbt entry, trap
.word 0 @ Check sum (set by flash programmer)
LDR PC, [PC, #20] @ IRQ entry, jump to IRQ handler
LDR PC, [PC, #20] @ FIQ entry, trap
.word Reset_Handler @ Reset handler
.word Trap @ Undefined Instruction handler
.word SWI_Handler @ Software Interrupt handler
.word Trap @ Prefetch Abort handler
.word Trap @ Data Abort handler
.word IRQ_Handler @ IRQ handler
FIQ_Addr: .word FIQ_Routine
....
FIQDisable:
MRS R0, SPSR
ORR R0, R0, #B_Fiq
MSR SPSR_c, R0
MOVS PC, LR
FIQEnable:
MRS R0, SPSR
BIC R0, R0, #B_Fiq
MSR SPSR_c, R0
MOVS PC, LR
In my main function I set the Fiq interruption using:
EXTMODE|=1<<0;
EXTINT=0x1;
VICIntSelect |= 0x00004000;
VICIntEnable = 0x00004000;
FiqEnable();
and start the while(1) loop that runs infinitaly.
When I press the button enter in the Interruptio routine:
void FIQ_Routine() {
int k;
//Força limpeza da interrupção (Caso de travamento)
if ((EXTINT==1)&&(T0TC>=tempo+1000)) {
EXTINT=0x1;
}
//Pega o endereço da fonte de interrupção.
k=EXTINT;
//Verifica se foi Ext0 que interrompeu
if(test_bit(k,0)) {
LCD_limpaLinha(2,16);
LCD_escreveMsgLC(2,1,"Botao apertado.");
Timer0_espera(1000);
}
tempo=T0TC;
EXTINT=0x1;
}
The execution back to main while(1) loop but when I pressed the button
again the Interruption doesnt work anymore.
Anyone can help me to solve this?