- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Are there any examples of how to set EM_EEPROM to a specific location, and then change that location after a certain amount of writes?
My EM_EEPROM is set up like this:
// EEPROM Array
static const uint8 CYCODE eepromArray[ARRAY_SIZE]= {0};
// Sets up data structure for EEPROM storage
struct eepromData
{
uint8 mode; // Running mode
uint8 program; // Program selected to run in program mode
uint8 speed; // speed of programs
uint8 brightness; // brightness of colors 0-10;
uint8 spectrum; // color based on spectrum location
uint8 white; // white level for spectrum use
uint8 channels; // stores whether there are 3 or 4 channels (RGB vs RGBW)
} dataLocal;
And written like this:
// Writes EEPROM structure into memory
void WriteEEPROM()
{
cystatus status;
// Writes EEPROM data
status = Em_EEPROM_Write((void *)(&dataLocal),(void *)(&eepromArray),ARRAY_SIZE);
}
Thank you,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
use
const struct { ...
and initialize the members, then it will be put into flash.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sounds like you want to do wear leveling.
To force absolute location - www.cypress.com/
http://www.cypress.com/?rid=91945
In Help, System reference Guides, there is a section on FLASH APIs to work
with FLASH.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Anyone can you tell me how to Read the data which is written by Em_EEPROM_Write ?
Is there any document telling about this?
Thanks & Regards,
Son
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Since you are using emEEPRom component to write, look at the second parameter:
eepromPtr: Pointer to the array or variable in flash representing the emulated EEPROM
so you just use *eepromPtr to de-reference. When using a variable in flash that was defined as
const uint16 MyEEPromVar = 0;
you better use memcpy() to retrieve the data: the compiler keeps the original value in mind and uses the initial const value of zero in this case.
Bob