Re: [avr-gcc-list] More observations: array of pointers to functions

2007-02-27 Thread Paulo Marques
David McNab wrote: On Mon, 2007-02-26 at 13:22 -0700, Eric Weddington wrote: The line that you have above does some pretty needles math. You should be able to just simply do: fptr = (FuncPtr)pgm_read_word(&funcs_table[i]); Does that make any difference in the size of your code? It would be

RE: [avr-gcc-list] More observations: array of pointers to functions

2007-02-26 Thread David McNab
On Mon, 2007-02-26 at 13:22 -0700, Eric Weddington wrote: > The line that you have above does some pretty needles math. You should be > able to just simply do: > > fptr = (FuncPtr)pgm_read_word(&funcs_table[i]); > > Does that make any difference in the size of your code? It would be > interes

RE: [avr-gcc-list] More observations: array of pointers to functions

2007-02-26 Thread Eric Weddington
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > org] On Behalf Of David McNab > Sent: Sunday, February 25, 2007 5:16 PM > To: avr-gcc-list@nongnu.org > Subject: [avr-gcc-list] More observations: array of pointers > to function

Re: [avr-gcc-list] More observations: array of pointers to functions

2007-02-25 Thread Joerg Wunsch
David McNab <[EMAIL PROTECTED]> wrote: > // define a macro to create a 'function pointer table handle' > #define pgm_get_functab(tab) (FuncPtrTable)(&tab[0]) &tab[0] is the same as tab. > I tried the approach of: >fptr = (FuncPtr)pgm_read_word(&funcs_table[0] + i * 2); > but it has a h

[avr-gcc-list] More observations: array of pointers to functions

2007-02-25 Thread David McNab
Hi all Further to the issue of storing a table of function pointers into flash, and accessing this table accurately.. I've tried several variations, and looked at the .lst files in each case. Some variations were more elegant to the C purist, but caused severe code bloat, even at -O3. But I've a