avr-libc-dev
[Top][All Lists]
Advanced

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

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


From: Dean Camera
Subject: Re: [avr-libc-dev] Re: C++ Interrupts
Date: Mon, 21 Jan 2008 18:08:58 +1100

--------------------------------------------------
From: "Ron Kreymborg" <address@hidden>
Sent: Monday, January 21, 2008 5:54 PM
To: "'Dean Camera'" <address@hidden>; <address@hidden>
Subject: RE: [avr-libc-dev] Re: C++ Interrupts

I did not want to call the interrupt myself. My intent was to make the
interrupt method private (and so essentially hidden) and with access to
private class data. Both of our versions fail in the latter
requirement. The method I listed in earlier mails does what I want but
I am still looking for a way to automatically mangle the name.

Dean
I was mistaken in thinking my earlier version gave me access to private
data. The compiler compiled without errors (which misled me) but on testing,
at runtime the interrupt routine executes with a null this pointer.

Class data access is the crux of this idea. It means the class can manage
everything associated with the interrupting device and only present public
methods that supply or remove data.

The method I have been using for a while where the interrupt handler calls a
public class method allowed private data access but of course the handler
was public and so was the interrupt:

ISR(TIMER0_OVF_vect)
{
   Timer0.TimerOverflow();
}

Any further suggestions you have are welcome.

Ron

What about a friend method? There must be a way of specifying the ISR as a friend to the CTimer0 class, allowing it access to the private data.

- Dean




reply via email to

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