This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
#pragma INTERRUPT (ResolverISR, HPI) #pragma INTERRUPT (MotorControlISR, LPI)
我在ti的controlsuit里面的28379的程序中看到了这样一行代码,我查了一下说与中断优先级有关系,能详细说明一下吗,谢谢!
文档:SPRU514G
6.10.10 The INTERRUPT Pragma
The INTERRUPT pragma enables you to handle interrupts directly with C code. In C, the argument func is
the name of a function. In C++, the pragma applies to the next function declared.
The syntax of the pragma in C is:
#pragma INTERRUPT ( func );
The syntax of the pragma in C++ is:
#pragma INTERRUPT ;
Except for _c_int00, which is the name reserved for the system reset interrupt for C programs, the name
of the interrupt (the func argument) does not need to conform to a naming convention.
On the FPU, there are two kinds of interrupts - High Priority Interrupt (HPI) and Low Priority Interrupt (LPI).
High priority interrupts use a fast context save and cannot be nested. Low priority interrupts behave like
normal C28x interrupts and can be nested.
The kind of interrupt can be specified by way of the interrupt pragma using an optional second argument.
The C syntax of the pragma is:
#pragma INTERRUPT ( func , {HPI|LPI} );
The syntax of the pragma in C++ is:
#pragma INTERRUPT ( {HPI|LPI} );
To specify an HPI interrupt use HPI. To specify an LPI interrupt use LPI. On FPU, if no interrupt priority is
specified LPI is assumed. Interrupts specified with the interrupt keyword also default to LPI.
ERIC