User`s guide

Pragmas for the DSP56800 and DSP56800E
Pragma Reference
395Targeting MC56F83xx/DSP5685x Controllers
Listing C.12 Sample Code - #pragma interrupt on | off | reset
#pragma interrupt off // To be used as default
value
// Non ISR code
#pragma interrupt on
void ISR_1(void) {
// ISR_1 code goes here.
}
void ISR_2(void) {
// ISR_2 code goes here.
}
#pragma interrupt reset
If the pragma is inside a function block, compile the current routine as an interrupt
routine. If the pragma is not inside a function block, compile the next routine as an
interrupt routine. This concept is developed in Listing C.13
.
Listing C.13 Sample Code - #pragma interrupt and function block
// Non ISR code
void ISR_1(void) {
#pragma interrupt
// ISR_1 code goes here.
}
#pragma interrupt
void ISR_2(void) {
// ISR_2 code goes here.
}
#pragma interrupt off
See Listing C.14 for an example of using the 'called' option in the interrupt pragma.
Listing C.14 Sample Code - using the ‘called’ option in # pragma interrupt
extern long Data1, Data2, Datain;
void ISR1_inc_Data1_by_Data2(void)
{
/* This is a routine called by the interrupt service routine ISR1(). */
#pragma interrupt called