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

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

Re: [avr-gcc-list] PSTR in a struct


From: Peter Bosscha
Subject: Re: [avr-gcc-list] PSTR in a struct
Date: Mon, 16 Sep 2002 07:40:10 +0200

Fairly simple:

1. do a typedef of you struct:

// Command Data Structure
typedef struct {
  byte whatever1;
  byte whatever2[CMDLEN];
} TCommand;


2. Declare your struct in PROGMEM

TCommand PROGMEM command[] =
{
etc.etc.

}

Regards
Peter

>>> Tom Harris <address@hidden> 16/09/2002 00:13:58 >>>
Greetings

I want to do something like this, but of course it won't work with
PSTR. Can
anyone give me a pointer? I would really like to learn how to place any
data
structure in program memory, out of precious RAM.

char*[] = {PSTR("Foo"), PSTR("Bar"), }

Tom Harris, Software Engineer
Optiscan Imaging, 15-17 Normanby Rd, Notting Hill, Melbourne, Vic
3168,
Australia
email address@hidden     ph +61 3 9538 3333  fax +61 3 9562 7742

This email may contain confidential information. If you have received
this
email in error, please delete it immediately,and inform us of the
mistake by
return email. Any form of reproduction, or further dissemination of
this
email is strictly prohibited. Also, please note that opinions expressed
in
this email are those of the author, and are not necessarily those of
Optiscan Pty Ltd.

avr-gcc-list at http://avr1.org 

avr-gcc-list at http://avr1.org



reply via email to

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