2005/9/9, E. Weddington <[EMAIL PROTECTED]>: > - I do like the idea that Royce has (above) about naming the ISR > function any name. However, I agree with Joerg, in that it would take an > awful lot of effort. Perhaps someday, but not now.
mspgcc interrupts are handled that way. Quoting from the mspgcc docs .... To make a routine an interrupt service routine, define it as follows: interrupt (INTERRUPT_VECTOR) IntServiceRoutine(void) { /* Any normal C code */ } where "INTERRUPT_VECTOR" is replaced with the name of the actual vector to be serviced. Definitions for these may be found in the header files. The generated code will save any registers used within the interrupt routine, and use the "RETI", rather than the usual "RET" instruction, to exit from the routine. The vector table will automatically point to the routine. Further interrupt related attributes are also recognised: interrupt (INTERRUPT_VECTOR) [wakeup, enablenested] IntServiceRoutine(void) { /* Any normal C code */ } The "wakeup" attribute makes the compiler alway force exit from any low power modes that may be in force at exit from the routine. See later for ways to gain greater control of the lower power modes. "enablenested" causes an interrupt enable instruction to be inserted before the function prologue. This allows other higher priority interrupts to be serviced while handling the current one. Use this feature with care if you use it in conjunction with "wakeup"! End quote ... -- Francisco _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list