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

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

[avr-gcc-list] Re: Array of pointers to functions


From: Royce & Sharal Pereira
Subject: [avr-gcc-list] Re: Array of pointers to functions
Date: Mon, 19 Jul 2004 14:54:28 +0530

Hi, J'org,

-----------------------------------
> void (*call_fun[])() PROGMEM = { fun1, fun2, fun3};

PROGMEM?  You gotta extract them with pgm_read_word().

---But does not the PROGMEM atribute cause the array to be located in Flash?

Is it really worth the hassle for just 3 pointers?  It'll save you 6
bytes of RAM...
-----------------------------------
Actually this was just an example, I have arrays of upto 16 function pointers!
And a 'switch' with 16 calls is not only ugly in comparison, it is also slow , 
besides more work to
write ;)

As a newbie, I am also curious how this could be done in avr-gcc, since it is 
very simple in SDCC,
with which I am familiar.

 Thanks,
--Royce.

--
J"org Wunsch                                           Unix support engineer
joerg_wunsch at3 interface-systems.de        http://www.interface-systems.de/~j/




reply via email to

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