This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

UCD3138 [ARM7] Compiler fail

Dear Expertise

I make a code for testing FIQ/IRQ Flag as below, but CCS6.0 compiler always show me error message.

#66 expected a ";".

Does anyone have any suggestions? thanks.

void test_for_FIQIRQ()
{
static Uint8 K1 = 0;
static Uint8 K2 = 0;

MiscAnalogRegs.GLBIOOE.bit.FAULT2_IO_OE = 1; // Test signal
MiscAnalogRegs.GLBIOEN.bit.FAULT2_IO_EN = 1; // Test signal
MiscAnalogRegs.GLBIOVAL.bit.FAULT2_IO_VALUE = 0;// Test signal

//make sure interrupts are disabled
asm(" MRS r2, cpsr "); // get psr
asm(" ORR r2, r2, #0xc0 "); // set interrupt disables
asm(" MSR cpsr_cf, r2 "); // restore psr

// If Int Mask FIQ Flag equal to 1, then jump to TST_FIQ_OK
//asm(" TST r2, #0x0040");
asm(" LSR r2, 2 ");
asm(" CMP r2, 0 ");
asm(" B TST_FIQ_OK ");
TST_FIQ_OK:
K1 = 1;

// If Int Mask IRQ Flag equal to 1, then jump to TST_IRQ_OK
//asm(" TST r2, #0x0080");
asm(" LSR r2, 2 ");
asm(" CMP r2, 0 ");
asm(" B TST_IRQ_OK ");
TST_IRQ_OK:
K2 = 1;

// disable_interrupt();
asm(" MRS r2, spsr "); //get saved psr
asm(" ORR r2, r2, #0x80 "); // set irq disable
asm(" MSR spsr_cf, r2 "); //restore saved psr

// disable_fast_interrupt(); 
asm(" MRS r2, spsr "); //get saved psr
asm(" ORR r2, r2, #0x40 "); // set fiq disable
asm(" MSR spsr_cf, r2 "); //restore saved psr

MiscAnalogRegs.GLBIOVAL.bit.FAULT2_IO_VALUE ^= 0; // do something like toggle GPIO

if (K1 != 0)
{ // enable_fast_interrupt();
asm(" MRS r2, spsr "); //get saved psr
asm(" BIC r2, r2, #0x40 "); // clear fiq disable
asm(" MSR spsr_cf, r2 "); //restore saved psr
K1 = 0;
}
if (K2 != 0)
{ // enable_interrupt();
asm(" MRS r2, spsr "); //get saved psr
asm(" BIC r2, r2, #0x80 "); // clear irq disable
asm(" MSR spsr_cf, r2 "); //restore saved psr
K2 = 0;
}
}

thanks.