This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

ISR in C++


Hi!,

I am using g++ 2.7.2.3 for the Hitachi SH1 processor. ( sh-hms target ).

The compiler works fine, but I am trying to do a interrupt service
routine in C++.
If I implement the ISR as a C++ function then it just crashes.
If I put the ISR in a .c file and then call a C++ function from it then
it works. More or less the code looks like this:

file1.c:

#pragma interrupt

void isr(void) {
 isrCPP__Fv();
}

file2.c:

void isrCPP() {
 // real interrupt service routine
}

BTW, Do you know why I must add a __Fv to the C++ function name?

But I believe there must be a better solution.
Any hint?
Thanks in advance,
Ivan

-- 
Ivan Porres Paltor                    Turku Centre for Computer Science
Åbo Akademi, Department of Computer Science  Phone: +358-2-2154033   
Lemminkäinengatan 14A                             
FIN-20520 Turku - Finland                    http://www.abo.fi/~iporres