Thread: EEPROM Code
View Single Post
  #20   Spotlight this post!  
Unread 13-10-2005, 13:38
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: EEPROM Code

Quote:
Originally Posted by sciguy125
I'm not sure, but I don't like that while

Code:
// wait, if necessary, for a free slot on the circular queue
while(EEPROM_Queue_Free_Space() == 0);
Won't that keep looping until the queue is full (which it never will be if it never leaves that loop)?
Yep, it's the while loop. I'm trying to write ninety-one bytes, but the queue only has sixteen slots. The code sits in the for loop and eventually EEPROM_Queue_Free_Space() returns zero forever because EEPROM_Write_Handler() isn't getting called to do the actual EEPROM write. The only way the code would work is if he queue size were changed to ninety-one slots. The trig table code seems like something that teams could use, so I'm writing a version that'll generate sin()/cos() and tan() tables in EEPROM. I'll also write the code to do the table lookup.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org