User`s guide
Pragmas for the DSP56800 and DSP56800E
Pragma Reference
392
Targeting MC56F83xx/DSP5685x Controllers
– You can use this argument on the function prototype or within the function
body as described below.
On the function prototype:
#pragma interrupt called
void function_called_from_interrupt (void);
Within the function body:
void function_called_from_interrupt (void)
{
#pragma interrupt called
asm (nop);
}
– You should use this pragma for all functions called from #pragma
interrupt enabled ISRs. This is optional for #pragma interrupt
saveall enabled ISRs, since for this case, the entire context is saved.
• pragma interrupt saveall [warn]
The compiler performs the following using the pragma interrupt
saveall [warn] argument:
– Always sets M01 to –1
– Sets OMR to system default (see OMR settings)
– Saves/restores entire hardware stack (see “Stack Frame and Alignment”
) via
runtime call
– Generates an RTI to return from interrupt
–If [warn] is present then emits a warning if the ISR makes a function call
that is not defined with #pragma interrupt called
Important considerations of usage:
– This type of usage is required within the ISR function body as follows:
void interrupt_function(void)
{
#pragma interrupt saveall
... code here
– This pragma should be used if the runtime library is called by the interrupt
routine