SW500009 Microchip Technology, SW500009 Datasheet - Page 79

HI-TECH FOR DSPIC/PIC24

SW500009

Manufacturer Part Number
SW500009
Description
HI-TECH FOR DSPIC/PIC24
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC24 & DsPICr
Datasheet

Specifications of SW500009

Supported Families
PIC24
Core Architecture
PIC, DsPIC
Software Edition
Standard
Kit Contents
Software And Docs
Tool Type
Compiler
Mcu Supported Families
PIC24 MCUs And DsPIC DSCs
Lead Free Status / RoHS Status
Not applicable / RoHS Compliant
For Use With/related Products
DSPIC3X/PIC24
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
025
778-1003
778-1003
C Language Features
main-line code may also use the #pragma interrupt_level directive to specify that they will never be
called by interrupt functions of one or more levels. This will prevent linker from issuing an error
message because the function was included in more than one call graph. Note that it is entirely up to
the user to ensure that the function is NOT called by both main-line and interrupt code at the same
time. This will normally be ensured by disabling interrupts before calling the function. It is not
sufficient to disable interrupts inside the function after it has been called.
plies to only the immediately following function. Multiple #pragma interrupt_level directives may
precede a non-interrupt function to specify that it will be protected from multiple interrupt levels.
3.10.1.8 Multiple Interrupts on High-End PICs
On High-End devices, the compiler allows a maximum of two interrupt routines to be active at any
given time. This is handled by the #pragma interrupt_level directive. The only available interrupt
levels are levels 0 and 1. Interrupts are level 0 by default.
1 interrupts use a separate memory area. Thus only one interrupt of each level may be active at any
given time. It is up to the user to ensure that this is the case. Interrupts may be re-enabled during an
interrupt routine as long as the only possible interrupt will be of a different level.
In addition, any non-interrupt functions that are called from an interrupt function and also from
An example of using the interrupt levels is given below. Note that the #pragma directive ap-
All level 0 interrupts share the same memory for saving context when the interrupt occurs. Level
/* non-interrupt function called by interrupt and by main-line code */
#pragma interrupt_level 1
void bill(){
}
/* two interrupt functions calling the same non-interrupt function */
#pragma interrupt_level 1
void interrupt fred(void) {
}
#pragma interrupt_level 1
void interrupt joh() {
}
main() {
}
int i;
i = 23;
bill();
bill();
bill();
Interrupt Handling in C
65

Related parts for SW500009