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.

#PRAGMA interrupt (func) [;] vs. interrupt keyword

I'm looking for some guidance for knowing which is the preferred and proper way to code up interrupt handlers in c code on the C5505/14/15 DSPs.

The SPRU281F provides two alternatives and I've seen code around that uses both methods.  The compiled code produces different results.

Can you please help me understand the differences between these two?

Can you please let me know when to use each each type?

5.7.13 The INTERRUPT Pragma

#PRAGMA interrupt (func) [;]

The INTERRUPT pragma enables you to handle interrupts directly with C code. In C, the argument 

vs.

func is the name of a function.

6.6.3 Using C/C++ Interrupt Routines

Interrupts can be handled directly with C/C++ functions by using the interrupt keyword. For example:

interrupt void isr()

{

...

}

 

  • What are the differences in the compiled code?

    Looking at my own code, I seem to be using both methods on the interrupt routines that I have written. Interrupt routines from sample source code that I have inherited seem to use the 'interrupt' keyboard alone, without the pragma.