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: Mon, 27 Oct 2003 13:45:51 -0500
User-agent: Opera7.21/Win32 M2 build 3218


Ok, how are you defining cmd_func_table? Does it reside in
RAM or Flash? How are you initializing it?

I want it all in Flash, strings, tables, pointers struct ...

This shows one complete entity:

typedef struct /* define the struct 'cmd_entry' */
{
     /* Pointer to string in flash: */
    PGM_P command;

/* Pointer to function in flash returning an int, passed a char pointer: */
    uint16_t (*function)(CONST char * tok_buf, CONST char * tok_ptr);
}str_func_entry;

static CONST char FLASH baud_str[] PROGMEM = "BAUD";

static uint16_t set_baud( CONST char * rate_ptr, CONST char * tok_ptr )
{
...
}

static FLASH str_func_entry cmd_func_table[] PROGMEM =
{
    {baud_str,          set_baud}
}



reply via email to

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