View Single Post
  #8   Spotlight this post!  
Unread 29-03-2004, 18:45
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: Sometimes autonomous cycles at half rate (19 Hz instead of 38 Hz)

Quote:
Originally Posted by gnormhurst
I think printf's are always suspect since I found a strange behavior: I would upload the code, it would start running, flooding the screen with printf output, so much that when I stopped the RC the screen kept going for a second or so. Then the program would not run again after a reset. I had to download the code each time to run it once. I got rid of most of the printfs, and that self-destructive behavior went away. Beware printfs!
Norm,

If you call printf() before the Initialize_Serial_Comms() call in user_initialization() you'll see this exact behavior.

I agree that printf() is a big resource hog and should be used sparingly. I'm working on an implementation of printf() that uses a circular buffer and the Tx interrupt to ease the problem a bit. If it works pretty well, I'll release it when I'm done.

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