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

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

[avr-gcc-list] typdefing 'cost' .. PROGMEM doesn't work


From: Reza Naima
Subject: [avr-gcc-list] typdefing 'cost' .. PROGMEM doesn't work
Date: Thu, 31 Jul 2003 23:43:21 -0700
User-agent: Mutt/1.4i

I'm confused in how 'const' is affecting the storage of arrays the
flash.  Take a look at these two cases and please tell me what's going
on ...


  | typedef const uint16_t prog_word PROGMEM; 
  | prog_word fontoffsetSevenet_7[] = { .... };

then fontoffsetSevenet_7 appears in the the .data section : 

  ] .data          0x00800213       0xcb font_Sevenet_7.o
  ]                0x00800213                fontoffsetSevenet_7


However, if I remove the const from the typedef and put it on the
array..

  | typedef uint16_t prog_word PROGMEM;
  | const prog_word fontoffsetSevenet_7[] = { .... };

then it appears in the .progmem section : 

  ] .progmem.data  0x000000aa      0x2fa font_Sevenet_7.o
  ]                0x000002e8                fontoffsetSevenet_7



Is this how it's supposed to behave, or is this a bug?  I'm running this
version of avr-gcc on linux : avr-gcc-3.2.90.20030512-1

Also, what's the advantage of const if it's already being saved in the
flash memory?  It can't get more constant than that.. Or is it for
compiler optimisations?

Thanks,
Reza




reply via email to

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