[Top][All Lists]

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

[avr-libc-dev] Re: C++ Interrupts

From: Dean Camera
Subject: [avr-libc-dev] Re: C++ Interrupts
Date: Sun, 20 Jan 2008 17:01:53 +1100


I'm not an expert in C++, nor the GCC compiler. Is there a reason why you 
cannot make the ISR with the normal name (i.e., not an explicit member of the 
Timer0 class) but still keep its prototype in the private class section?

However, if you *really* want to make it a member, I believe that using the 

extern "C"


Around the Interrupt handler might fix the problem, as it should prevent the 
compiler from mangling the function name. I need to test that (which I'll do 
now), but if so I could alter the interrupt.h header file to make it compatible 
with C++. It's possible that GCC won't like the extern "C" when dealing with a 
class member, so that's why I need to test it.

Note that a side-effect of turning off the name mangling is that the ISR can 
only be specified once, which is desired behavior anyway.

- Dean Camera

reply via email to

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