Joerg Wunsch wrote:
As Wojtek Kaniewski wrote:


What about the SIG_ prefix? If we'll move to something else than
SIGNAL(), I think that it should be dropped or somehow hidden from
the users.


Very good point.  I've been thinking about adding a second set of
vector names anyway.  Our names are completely self-invented.  In the
long run, I'd rather like to migrate the names as they appear in the
Atmel XML files, which incidentally also match those IAR is using.

So e.g., SIG_INTERRUPT0 would get an alias named INT0_vect.

this is good either, but the prefixes has the advantage of better usage of intellisense/autocomplete...
(SIG_<ctrl+space>)


As Royce Pereira wrote:


In SDCC (mcs51 open source C compiler) one can name their ISR as
anything, and then set an attribute to specify it as an ISR for a
specific source.


void zerocrossover(void) interrupt EXT0


Can this be done with AVR-GCC and what would be the problems
implementing this?


Not easily.  It would require massive changes in both, GCC and
avr-libc, and I don't see any obvious advantage that would justify the
effort required to do this.


Well this is not the same, but if you want i belive you could use this:

interrupt(SIG_INTERRUPT0,zerocrossover) void zerocrossover(void)
{
  //...
}

with teese macros:

#define interrupt(signame,func)                \
void func (void) __attribute__ ((signal));     \
void signame (void) __attribute__ ((naked));   \
void signame (void)                            \
{                                              \
        asm("rjmp " #func);                    \
}

#define interrupt_wIE(signame,func)            \
void func (void) __attribute__ ((signal));     \
void signame (void) __attribute__ ((naked));   \
void signame (void)                            \
{                                              \
  asm("sei\n\t"                              \
      "rjmp " #func);                        \
}


unfortunately this deasn't work:

#define interrupt(signame,func)                \
static inline void func (void) __attribute__ ((signal));     \
void signame (void) __attribute__ ((naked));   \
void signame (void)                            \
{                                              \
        func();                                    \
}                                              \
static inline

for some reason the compiler wont inline functions with signal attribute. :(


--
Istvan Szikra



_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to