[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Re: [avr-libc-dev] RFD: more avr-libc API changes

From: Francisco Silva
Subject: Re: [avr-gcc-list] Re: [avr-libc-dev] RFD: more avr-libc API changes
Date: Fri, 9 Sep 2005 14:32:17 -0300

2005/9/9, E. Weddington <address@hidden>:

> - 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 ...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]