[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] How to convert Flash Strings from IAR to GCC?
From: |
E . Weddington |
Subject: |
Re: [avr-gcc-list] How to convert Flash Strings from IAR to GCC? |
Date: |
Fri, 24 Oct 2003 23:33:38 GMT |
>
> I'm trying to convert some code from IAR 2.28 to GCC ,
but I can't get
> the GCC version to read strings from flash, the way that
IAR does.
>
> I've read the FAQ on getting string in Flash, and the
recent thread on
> "Strings in Flash".
>
> I know I could use pgm_read_byte_near() in the case I
show here, but I
> need to stay backwards compatible with IAR,
unfortunately, and it appears in
> several different places that one I show here.
>
> How do I get GCC to generate functions that automatically
uses LPM the way
> IAR does?
You can't.
GCC does not automatically generate LPM the way that IAR
does. That's why there are macros in avr-libc to generate
the necessary assembly code to read data from Flash.
That's why it's necessary to use the pgm_read_* macros
inside your flash_str_out function.
Eric