[Top][All Lists]

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

RE: [avr-gcc-list] migrating from iar to gcc

From: Dave Hylands
Subject: RE: [avr-gcc-list] migrating from iar to gcc
Date: Mon, 13 Sep 2004 07:13:55 -0700

Hi Missimiliano,

> I have some sources writed for iar compiler. I want to port these
> sources to gcc.
> I don't know how to translate this:
> char __flash *p;
> p is a pointer stored in default memory. The pointer
> points to an integer in flash memory.
> how is translated this declaration in gcc?

I'm sharing some new found knowledge, which I'm hoping is correct...

You can write it a couple of ways:

        prog_char       *p;
        char *p PROGMEM;

In either case, you'll need to add

        #include <avr/pgmspace.h>

In order to get the correct definitions.

If you want to initialize p with a string, use the PSTR macro:

        prog_char *p = PSTR( "Test" );

Dave Hylands
Vancouver, BC, Canada

reply via email to

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