ISR in C++

Ivan Porres Paltor iporres@abo.fi
Mon Aug 3 23:54:00 GMT 1998


Ivan Porres Paltor wrote:
> 
> 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++.

Thanks to the people that helped me with the previous post.
Now, I realized that my g++ ignores the "#pragma interrupt" directive.
I.e.:

#pragma interrupt
extern "C"
void isrCPP {
 //
};

The compiler accepts this code, but it does not save or restore the
registers and does not add a "Return-from-Interruption" op-code (rete in
the asm).

Is it a known bug? I am missing something?
Also, I am interested in a good OO mechanism to dispatch the interrupts.
If you know a good reference or you want to discuss about it please tell
me.  

Thanks,
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



More information about the crossgcc mailing list