AnsweredAssumed Answered

Bf537 ISR setup in asm

Question asked by Fagner on Jan 25, 2010
Latest reply on Jan 26, 2010 by AndyR

Hi,

 

I am using an example software from the gnu toolchain to produce a standalone program. But they use a different sintax to setup the ISR. The sintax i always used (register_handler...) do not work there.The example code is below.

Could anyone help me explaining the meaning of: asm volatile ("cli %0; bitset (%0, 11); bitset (%0, 12); sti %0; csync;": "+d"(i));

And how do i use this sintax to setup the others interrupts?

 

 

void Init_Interrupts(void)
{
  int i;
    // assign core IDs to interrupts
    *pSIC_IAR0 = 0xffffffff;
    *pSIC_IAR1 = 0xffffffff;
    *pSIC_IAR2 = 0xffff4fff;                    // Timer0 -> ID4;
    *pSIC_IAR3 = 0xffff5fff;                    // PORTF IntA -> ID5

 

    // assign ISRs to interrupt vectors
    //register_handler(ik_ivg11, Timer0_ISR);        // Timer0 ISR -> IVG 11
    //register_handler(ik_ivg12, PORTF_IntA_ISR);    // PORTF_IntA_ISR -> IVG 12
    *pEVT11 = Timer0_ISR;
    *pEVT12 = PORTF_IntA_ISR;

 

    asm volatile ("cli %0; bitset (%0, 11); bitset (%0, 12); sti %0; csync;": "+d"(i));

 

    // enable Timer0 and PORTF IntA interrupt
    *pSIC_IMASK = 0x08080000;
}

 

regards,

Fagner

Outcomes