[Top][All Lists]

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

Re: [avr-gcc-list] How to handle interrupt vectors ?

From: Joerg Wunsch
Subject: Re: [avr-gcc-list] How to handle interrupt vectors ?
Date: Tue, 28 Oct 2008 21:27:00 +0100 (MET)

Charalampos Alexopoulos <address@hidden> wrote:

> class Timer0:
> {
>     public:
>           static const vector overflow = _VECTOR(9);
>           ...
>           ...
> };

This simply cannot work using the current interrupt vector handling of
avr-libc.  The main reason is that the __vector_N name /must/ be a
global symbol, and it /must not/ be a C++ mangled name, so you cannot
hide it somewhere within your class.  If the vector is not found by
the linker by this global name, the linker will simply fill in the
default stubs from gcrt0.o which are weak global symbols intended to
fill into any vector slot not defined by a user application.

You might perhaps do some dirty tricks using global name aliases, but
as others already pointed out, I also doubt this will have any
practical utility beyond puristic academic value.  By the time an
interrupt is triggered by hardware, there is simply no "object" the
run-time environment could pick up to "bind" the vector onto.

cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

reply via email to

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