View Single Post
  #29   Spotlight this post!  
Unread 21-01-2004, 09:59
WizardOfAz's Avatar
WizardOfAz WizardOfAz is offline
Lead Mentor
AKA: Bill Bennett
FRC #1011 (CRUSH)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Tucson, AZ
Posts: 101
WizardOfAz will become famous soon enough
Send a message via AIM to WizardOfAz
Re: read/write EEPROM on 18F8520

I noticed there are (at least) two minor flaws in the code above, neither of which would break it.
(1) string.h is not needed. It's there because I had a memset in the code at one point, then got rid of it and didn't remove the include
(2) in the eeControlStruct structure, the line "unsigned :4;" should be "unsigned :5;". The purpose is to get the 4 bit numbers aligned so that the compiled code to access them will be efficient. Maybe the compiler aligned it anyway, I don't know.

Anyway, the code works w/o these changes, since our system uses it with correct results. But I saw them and wanted to pass along the changes to the thousands of you that are using this by now [;-)

Bill