On Wed, Oct 21, 2009 at 07:40:50AM -0700, Parthasaradhi Nayani wrote: > > >From: Michael Clift <mich...@clift.com.au> > > > >??? Hi, I am using winavr, and would like to include the default > >eeprom values (normally output >to .eep) in flash memory. I want to > >do this so that my application can easily default the >eeprom. > > Hello, > EEPROM data in FLASH memory? then the easy way is to use the PGM space > attribute to the variables you want in flash.
Ditto. Declare the variables twice, once with a name that is obvious to you is EEPROM in the EEPROM space, and again with a name that is obvious to you is stored in FLASH. Then when/if you wish to restore EEPROM contents to their initial default values use the PGM modifier to read from FLASH and call the routine(s) used to write EEPROM. Duplicating the default data in your source code sounds wasteful but it will be easier to understand 6 months from now than an edit of the Makefile plus hacks to the memory segment definitions. I think it is possible that way to write the .eeprom segment to two places in memory, is just that you don't want to do it that way when there is an easier way that is also easier to understand. -- David Kelly N4HHE, dke...@hiwaay.net ======================================================================== Whom computers would destroy, they must first drive mad. _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list