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

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

Re: [avr-gcc-list] Pointer to a function in a structure in flash?


From: Bob Paddock
Subject: Re: [avr-gcc-list] Pointer to a function in a structure in flash?
Date: Tue, 28 Oct 2003 08:16:52 -0500
User-agent: Opera7.21/Win32 M2 build 3218

On Mon, 27 Oct 2003 22:20:30 GMT, E.Weddington <address@hidden> wrote:

                #if defined( __GCC_VERSION__ )
                    retval =
(*((functype_t)(pgm_read_word(&cmd_func_table
[i].function))))((char
const>
*)token,                (char const *)tokptr);
                #endif

[Sorry for any weird wrapping above.]

You also wrote:

Then this sounds like it's an issue with getting 'token'

It was, I had a PROGMEM where it should not have been.

Also, shouldn't you change the GCC portion (above) to:

I tried that and the system goes off to never-never-land, what I have
above works, below does not (I did change [0] to [i] as required).

#if defined( __GCC_VERSION__ )
retval = cmd_func_table[0].function((CONST char *) token,
(CONST char *) tokptr);
#endif



reply via email to

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