avr-libc-dev
[Top][All Lists]
Advanced

[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: Szikra Istvan
Subject: Re: [avr-gcc-list] Re: [avr-libc-dev] RFD: more avr-libc API changes
Date: Fri, 09 Sep 2005 14:00:52 +0200
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

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





reply via email to

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