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

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

[avr-gcc-list] array of string in progmem


From: Uwe Fechner
Subject: [avr-gcc-list] array of string in progmem
Date: Wed, 19 Apr 2006 10:52:36 +0200
User-agent: Mail/News 1.5 (X11/20060311)

Hello,

can someone explain, how I can put an array of strings into
the flash memory?

The current implementation looks like this:

// command list
// -commands are null-terminated strings
static char
CmdlineCommandList[CMDLINE_MAX_COMMANDS][CMDLINE_MAX_CMD_LENGTH];

And it is used like this:

    // search command list for match with entered command
    for(cmdIndex=0; cmdIndex<CmdlineNumCommands; cmdIndex++)
    {
        if( !strncmp(CmdlineCommandList[cmdIndex], CmdlineBuffer, i) )
        {
            // user-entered command matched a command in the list (database)
            // run the corresponding function
            CmdlineExecFunction = CmdlineFunctionList[cmdIndex];
            // new prompt will be output after user function runs
            // and we're done
            return;
        }
    }

(From Peter Fleurys library.)

I know, I can use the strncmp_P() function to access a string in
progmem, but how do
I declare an array of strings in progmem?

Any help appreciated.

Uwe Fechner




reply via email to

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