[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] initial values in structs
From: |
E. Weddington |
Subject: |
Re: [avr-gcc-list] initial values in structs |
Date: |
Mon, 21 Apr 2003 09:08:56 -0600 |
On 19 Apr 2003 at 0:41, Tyler Hall wrote:
> I've read through the avrlibc docs and FAQ, and I see a "possible"
> solution to this, but it's pretty messy
>
<snip>
> The only solution I've seen for this is to tag a symbol to each string
> and add the PROGMEM attrib to each one, then use the symbol in the
> struct initialization:
>
> prog_char gString1[] PROGMEM = "firstname";
> prog_char gString2[] PROGMEM = "secondname";
>
> mystruct_type local_mystruct[] PROGMEM = {
> { gString1, blah blah blah },
> { gStrign2, blah blah blah }
> };
>
> Is that the only to do this?
>
That's the way to do it. This method is listed under the FAQ.
Eric