[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] avr-g++ and interrupt vectors
From: |
Geoffrey Wossum |
Subject: |
Re: [avr-gcc-list] avr-g++ and interrupt vectors |
Date: |
Fri, 5 Jul 2002 14:22:04 -0500 (CDT) |
>
> Hi!
>
> I am experimenting with C++ on the AVR, trying to implement a simple
> class for a timer. I ran into a problem when trying to declare the ISR
> as part of the class.
>
> In plain old C, my ISR looks like this:
>
> SIGNAL( SIG_OVERFLOW1 )
> {
> timer_count++;
> }
>
> In my C++ implementation what must I use ?
>
> I would expect something like
>
> SIGNAL( SIG_OVERFLOW1 ) // <- Make vector jump to Timer::Interrupt
> Timer::Interrupt()
> {
> count++;
> }
>
> The main issue is that Timer::Interrupt() should be a private member
> function of Timer. If not, I could use the plain C alternative and make
> Timer::count public, however, this is not what I want.
>
>
> Regards,
> Nils
>
>
> avr-gcc-list at http://avr1.org
>
avr-gcc-list at http://avr1.org