AnsweredAssumed Answered

Questions on software interrupt and number of callback functions on CCES

Question asked by nigong on Sep 26, 2013
Latest reply on Oct 2, 2013 by SteveM

Hi,

 

Question1:

I wanted to use raise instruction to generate software interrupt so that I can test the program without actually tackling the hardware. I am using BF533.

 

I set up an push button (GPIO) interrupt and it worked fine. Here is the code how I set it up:

void main(){
...
sicResult = adi_sic_SetIVGLevel(
                        (uint32_t)          ADI_SID_PFA,          // System Interrupt ID
                        (uint32_t)          12u);                              // IVGLevel
    CheckResult(result);


    int inParam = 5;
    intResult = adi_int_InstallHandler(
                        (uint32_t)                                                  ADI_SID_PFA,
                        (ADI_INT_HANDLER_PTR)                    PFAIntHandler,
                        (void *)                                                  &inParam,
                        (bool)                                                            true
                        );
    CheckResult(intResult);
...
}


static void PFAIntHandler(uint32_t iid, void* handlerArg)
{
          intCount++;
          *pFIO_FLAG_C = 0x100 | 0x200;
}

 

Then I tried to use the raise instruction:

raise_intr (12);

 

It didn't go to the interrupt handler (PFAIntHandler), neither it sets the 12th bit of ILAT.

 

However, if I try:

raise_intr (1);

 

It did reset the processor.

 

I am wondering if the raise instruction still works on all the interrupts on CCES. If not, what is the substitute function of it on CCES?

 

Question 2:

Since I built this on top of the GPIO push botton and LED example provided by CCES examples, the push buttons already have a callback function (blinking the LEDs) matched. But if I set a interrupt on the push button, the original callback function would not be called. It seems like CCES only allows one "callback" to be called, or the interrupt handler I wrote clears the related bits that trigger the original callback function.

 

Am I understanding correctly?

 

Thanks,

Dongcheng

Outcomes