avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] How to handle interrupt vectors ?


From: dlc
Subject: Re: [avr-gcc-list] How to handle interrupt vectors ?
Date: Tue, 28 Oct 2008 13:21:39 -0600
User-agent: Thunderbird 2.0.0.14 (Macintosh/20080421)



Pink Boy wrote:
Charalampos Alexopoulos sez,

Thank you for your answer, but i am not looking for the
easiest way. I want to have some solution similar to previus example. I can use ISR's even with c++ with no problem, what i need, as i said before, is to assign a vector as a static class member in a way similar to other types like :

class foo
{
    public:
          static constant uint8_t data = 0x0a;
          ...
}

then you can use it from some other class like:

uint8_t local_data = foo::data;

You scare me.  Run away.

I always worry with C++ that I really don't understand what the compiler is doing when it calls functions. I guess my thought is
that if you can't define the function as an isr inside the class
then what you are trying to do isn't supported.

If I were you and I'm not, I would have an ISR call your static
function, then exit.  That will most likely work.  In general
though I like to keep what I'm do in an ISR very simple (buffer
data, generate events, time critical stuff) and let the main loop or a task handle the complex stuff.


I totally agree. An ISR is NOT the place to put "pointer chasing" C++ dribbles. I don't even like to call a function there! There is no rule that says that every construct in a C++ program has to use the C++ object paradigms. Define your ISR's using the smallest possible code. You will NEVER be dealing with an ISR as part of another object, nor will you ever likely inherit from an ISR. Realistically ISR's are a thing apart from the rest of the program (usually) so this is rarely an issue.

IMO, IME,
DLC


Mr Foo




_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

--
-------------------------------------------------
Dennis Clark          TTT Enterprises
www.techtoystoday.com
-------------------------------------------------




reply via email to

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