MPLAB ? C32 C Compiler User’s Guide
# pragma interrupt function-name ipl n [ vector [ @ ] vector-number [,
vector-number-list ]]
# pragma interrupt function-name
single [ vector [ @ ] 0
Where n is in the range of 0..7, inclusive. The ipl x specifier may be all uppercase or
all lowercase.
The function definition for a handler function indicated by an interrupt pragma must
follow in the same translation unit as the pragma itself.
The interrupt attribute will also indicate that a function definition is an interrupt
handler. It is functionally equivalent to the interrupt pragma.
For example, the definitions of foo below both indicate that it is an interrupt handler
function for an interrupt of priority 4.
#pragma interrupt foo ipl4
void foo (void)
is functionally equivalent to
void __attribute__ ((interrupt(ipl4))) foo (void)
3.4
ASSOCIATING A HANDLER FUNCTION WITH AN EXCEPTION VECTOR
There are 64 exception vectors, numbered 0..63 inclusive. Each interrupt source is
mapped to an exception vector as specified in the device data sheet. By default, four
words of space are reserved at each vector address for a dispatch to the handler
function for that exception source.
An interrupt handler function can be associated with an interrupt vector either as the
target of a dispatch function located at the exception vector address, or as being
located directly at the exception vector address. A single handler function can be the
target of multiple dispatch functions.
The association of a handler function to one or more exception vector addresses is
specified via a clause of the interrupt pragma, a separate vector pragma, or a vector
attribute on the function declaration.
3.4.1
Interrupt Pragma Clause
The interrupt pragma has an optional vector clause following the priority specifier.
# pragma interrupt function-name ipl-specifier [ vector
[ @ ] vector-number [, vector-number-list ]]
A dispatch function targeting the specified handler function will be created at the
exception vector address for the specified vector numbers. If the first vector number is
specified with a preceding “@” symbol, the handler function itself will be located there
directly.
For example, the following pragma specifies that function foo will be created as an
interrupt handler function of priority four. foo will be located at the address of exception
vector 54. A dispatch function targeting foo will be created at exception vector address
34.
#pragma interrupt foo ipl4 vector @54, 34
The following pragma specifies that function bar will be created as an interrupt handler
function of priority five. bar will be located in general purpose program memory (.text
section). A dispatch function targeting bar will be created at exception vector address
23.
#pragma interrupt bar ipl5 vector 23
DS51686A-page 48
? 2007 Microchip Technology Inc.
相关PDF资料
SW300003-EVAL LIBRARY SOFT MODEM-EVAL ONLY
SW300010-EVAL SPEECH RECOG LIBRARY-EVAL ONLY
SW300040-EVAL LIBRARY NOISE SUPPR-EVAL ONLY
SW300060-EVAL LIBRARY ACOUSTIC ECHO-EVAL ONLY
SW300070-EVAL SOFTWARE LIBR ENC/DEC EVAL ONLY
SW500012 HI-TECH C PRO FOR PIC32
SY87701LHI-EVAL BOARD EVAL SY87701 EXPERIMENT
SY87729LHI-EVAL BOARD EVAL N SY87729 EXPERIMENT
相关代理商/技术参数
SW006021-1 制造商:Microchip Technology 功能描述:MPLAB XC8 STANDARD COMPILER 制造商:Microchip Technology Inc 功能描述:COMPILER MPLAB XC8 STD 制造商:Microchip Technology Inc 功能描述:COMPILER MPLAB XC8 STANDARD 制造商:Microchip Technology Inc 功能描述:COMPILER, MPLAB XC8, STANDARD 制造商:Microchip Technology Inc 功能描述:MPLAB XC8 ANSI C Compiler for the PIC10 (12),(16),(18) (Workstation License) 制造商:Microchip Technology Inc 功能描述:MPLAB XC8 Standard Compiler 制造商:Microchip Technology Inc 功能描述:OPTOCOUPLERS; Core Architecture:PIC; Software Edition:Standard
SW006021-1N 制造商:Microchip Technology 功能描述:MPLAB XC8 STANDARD COMPILER (F 制造商:Microchip Technology Inc 功能描述:MPLAB XC8 STANDARD COMPILER (FLOATING LICENSE) - Boxed Product (Development Kits) 制造商:Microchip Technology Inc 功能描述:COMPILER MPLAB XC8 STD FLOAT LIC 制造商:Microchip Technology Inc 功能描述:MPLAB XC8 Standard Compiler (Fltng Lic)
SW006021-2 制造商:Microchip Technology 功能描述:MPLAB XC8 PRO COMPILER WORKSTATION LICENSE 制造商:Microchip Technology Inc 功能描述:MPLAB XC8 PRO COMPILER - Boxed Product (Development Kits) 制造商:Microchip Technology Inc 功能描述:COMPILER MPLAB XC8 PRO 制造商:Microchip Technology Inc 功能描述:COMPILER, MPLAB XC8, PRO 制造商:Microchip Technology Inc 功能描述:MPLAB XC8 ANSI PRO Compiler for the PIC10 (12),(16),(18) (Workstation License) 制造商:Microchip Technology Inc 功能描述:MPLAB XC8 PRO Compiler 制造商:Microchip Technology Inc 功能描述:SOFTWARE TOOL, MPLAB XC8 PRO COMPILER; Core Architecture:PIC; Supported Families:PIC10, PIC16, PIC18; Software Edition:Linux; License Type:Floating - node; No. of User Licenses:1; Supported Hosts:-
SW006021-2C 制造商:Microchip Technology Inc 功能描述:COMPILER MPLAB XC8 PRO CHI
SW006021-2N 功能描述:开发软件 MPLAB XC8 PRO Compiler (Fltng Lic) RoHS:否 制造商:Atollic Inc. 产品:Compilers/Debuggers 用于:ARM7, ARM9, Cortex-A, Cortex-M, Cortex-R Processors
SW006022-1 制造商:Microchip Technology 功能描述:MPLAB XC16 STANDARD COMPILER 制造商:Microchip Technology Inc 功能描述:MPLAB XC16 STANDARD COMPILER - Boxed Product (Development Kits) 制造商:Microchip Technology Inc 功能描述:COMPILER MPLAB XC16 STD 制造商:Microchip Technology Inc 功能描述:COMPILER MPLAB XC16 STANDARD 制造商:Microchip Technology Inc 功能描述:COMPILER, MPLAB XC16, STANDARD 制造商:Microchip Technology Inc 功能描述:MPLAB XC16 Standard Compiler (Workstation License) 制造商:Microchip Technology Inc 功能描述:OPTOCOUPLERS; Core Architecture:PIC, dsPIC; Software Edition:Standard
SW006022-1N 制造商:Microchip Technology 功能描述:MPLAB XC16 STANDARD COMPILER ( 制造商:Microchip Technology Inc 功能描述:MPLAB XC16 STANDARD COMPILER (FLOATING LICENSE) - Boxed Product (Development Kits) 制造商:Microchip Technology Inc 功能描述:COMPILER MPLAB XC16 FLOAT LIC 制造商:Microchip Technology Inc 功能描述:MPLAB XC16 Standard Compiler (Fltng Lic)
SW006022-2 功能描述:开发软件 MPLAB XC16 PRO Compiler RoHS:否 制造商:Microchip Technology 产品: 用于: