Thread: EEPROM Code
View Single Post
  #28   Spotlight this post!  
Unread 09-11-2005, 14:11
kc8nod's Avatar
kc8nod kc8nod is offline
Registered User
AKA: Ted Hansen
FRC #1216 (Knights)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Oak Park Michigan
Posts: 43
kc8nod is on a distinguished road
Re: EEPROM Code

Quote:
Originally Posted by Kevin Watson
The range is 0 to 1023. I guess I should add that bit of information to the read me file.

-Kevin
Hi Kevin,

I've got a question about EEPROM_Write().

Code:
unsigned char EEPROM_Write(unsigned int address, unsigned char data)
{
	unsigned char return_value;

	// return error flag if the queue is full
	if(eeprom_queue_full == FALSE)
	{
		// put the byte and its address on their respective circular queues
		eeprom_queue_data[eeprom_queue_write_index] = data;
		eeprom_queue_address[eeprom_queue_write_index] = address;
	
		// increment the queue byte count
		eeprom_queue_count++;
The parameter address is an unsigned integer, but eeprom_queue_address is an array of unsigned chars. Aren't you chopping off two bits from the address? Or did you mean to define eeprom_queue_address as an unsigned int also?