avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] -fwhole-program ate my ISR!


From: Ned Konz
Subject: Re: [avr-gcc-list] -fwhole-program ate my ISR!
Date: Sat, 22 Apr 2006 08:59:46 -0700


On Apr 22, 2006, at 7:27 AM, Bernd Trog wrote:


Ned, do you see any change in code size?


Well, it was smaller when it deleted the ISR <g>.

So far I've only tried this on toy programs, so I can't tell.

I found that adding

__attribute__ ((used))

before the ISR() definition kept this from happening.

There is this "externally_visible" attribute too.
I don't know which is better.

Hmm... I think it would probably be best to have both:

#ifdef __cplusplus
#define ISR(vector)                                    \
-extern "C" void vector(void) __attribute__ ((signal)); \
+extern "C" void vector(void) __attribute__ ((signal, used, externally_visible)); \
void vector (void)
#else
#define ISR(vector)                                    \
-void vector (void) __attribute__ ((signal));           \
+void vector (void) __attribute__ ((signal, used, externally_visible)); \
void vector (void)
#endif


--
Ned Konz
address@hidden






reply via email to

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