| |||||
Technical Support Support Resources
Product Information | GCC: PROBLEMS WITH LOCAL VARIABLES IN INTERRUPTSInformation in this article applies to:
QUESTIONI have a complex interrupt function that uses local variables. It seems that the GNU compiler does not generate correct code for it. Is there a known problem? My code looks like:
void intr_func (void) __attribute__ ((interrupt)); // Generate Interrupt
void intr_func (void) {
int a, b, c, d;
: /* function code */
}
ANSWERYes, there is a problem in the GNU V3.22 compiler. For the moment, we recommend using the following work-around:
void intr_wrapper (void) __attribute__ ((interrupt)); // Generate Interrupt
void intr_wrapper (void) {
intr_func ();
}
Use the wrapper function around the interrupt and the correct code is generated. Last Reviewed: Monday, July 10, 2006 | ||||
| |||||