![Texas Instruments TMS320C2x User Manual Download Page 148](http://html1.mh-extra.com/html/texas-instruments/tms320c2x/tms320c2x_user-manual_1097073148.webp)
Interrupt Handling
6-25
Run-Time Environment
6.5 Interrupt Handling
As long as you follow the guidelines in this section, you can interrupt and return
to C code without disrupting the C environment. When the C environment is
initialized, the startup routine does not enable or disable interrupts. Interrupts
are disabled if the system is initialized via a hardware reset. If your system
uses interrupts, you must handle any required enabling or masking of inter-
rupts. Such operations have no effect on the C environment and are easily
incorporated with asm statements or by callling an assembly language func-
tion.
6.5.1 General Points About Interrupts
-
An interrupt routine can perform any task performed by any other function,
including accessing global variables, allocating local variables, and calling
other functions.
-
When an interrupt routine is entered, the run-time-support function
I$$SAVE is called to save the complete context of the interrupted function.
All
registers are saved. Upon return from the interrupt routine, the run-
time-support function I$$REST is called to restore the environment and
return to the interrupted function.
-
The name c_int0 is the C entry point; this name is reserved for the system
reset interrupt. This special interrupt routine initializes the system and
calls the function main. Because it has no caller, c_int0 does not save any
registers.
-
To associate an interrupt routine with an interrupt, a branch must be placed
in the appropriate interrupt vector. You can use the assembler and linker
to do this by creating a simple table of branch instructions with the .sect
assembler directive. For information on where the interrupt vector table is
located, consult the user’s guide for the device you are targeting.
Summary of Contents for TMS320C2x
Page 8: ...viii...
Page 69: ...2 47 C Compiler Description...
Page 159: ...6 36...
Page 226: ...8 6...