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

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

[avr-gcc-list] Re: including default eeprom values in flash memory


From: Heike C. Zimmerer
Subject: [avr-gcc-list] Re: including default eeprom values in flash memory
Date: Wed, 21 Oct 2009 17:58:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Michael Clift <address@hidden> writes:

> 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. Whats the best way
> to do this? can it be done with a modification to the linker script?
> or should it be done in the makefile somehow?

If you put the data into a struct like this:

struct test {
  int i;
  char s[6];
};
struct test x PROGMEM = {7, "HELLO"};

then just read byte per byte from x for sizeof(x) times and write it
into your EEPROM.

Heike





reply via email to

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