|
From: | Bob Paddock |
Subject: | Re: [avr-chat] ?Optimized eeprom? |
Date: | Fri, 16 Jun 2006 09:56:15 -0400 |
User-agent: | Opera M2/8.54 (Win32, build 7730) |
The only reliable, repeatable and maintainable (i.e., without manuallyspecifying each address) way to get consistent addresses is to put all your eeprom data into a single struct. It's best to make sure that any padding involved is explicit (using the "-wpadded" warning).
Use offsetof() in stddef.h:"Almost never used, the offsetof() macro can actually be a helpful addition to your bag of tricks. Here are a couple of places in embedded systems where the macro is indispensable?packing data
structures and describing how EEPROM data are stored." see "Learn a new trick with the offsetof() macro": http://www.embedded.com/showArticle.jhtml?articleID=18312031 and "Data formats change over time. To make upgrades easier, track these changes with version numbers.": http://www.embedded.com/shared/printableArticle.jhtml?articleID=9900199
[Prev in Thread] | Current Thread | [Next in Thread] |