[Top][All Lists]

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

Re: [avr-gcc-list] Constatnts in .data section

From: Reza Naima
Subject: Re: [avr-gcc-list] Constatnts in .data section
Date: Wed, 01 Jun 2005 12:42:50 -0700
User-agent: Mozilla Thunderbird 1.0 (Macintosh/20041206)

#include <avr/pgmspace.h>

typedef uint16_t prog_uint16 PROGMEM;
const static prog_uint16 mm_days[12] = {...}


foo =  pgm_read_word( &mm_days[i] );

or something like that..


Alex Kholodenko wrote:

I have in my code some constants like this one for example:
const static uint16_t mm_days[12]=
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
As far as I can see it will be placed in .data section in RAM after init. I would prefer to have it in flash memory and not to spend RAM for it. I can afford speed reduction in access to this area. So how can I force gcc to do it if it is possible. Thanks. Alex.
I'm not a member of the list so please take care to "reply all"


AVR-GCC-list mailing list

reply via email to

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