This is the mail archive of the 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++


I am using g++ 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:


#pragma interrupt

void isr(void) {


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 Porres Paltor                    Turku Centre for Computer Science
Åbo Akademi, Department of Computer Science  Phone: +358-2-2154033   
Lemminkäinengatan 14A                             
FIN-20520 Turku - Finland