View Single Post
  #13   Spotlight this post!  
Unread 09-02-2008, 20:03
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: printf() inside interrupt routine?

Quote:
Originally Posted by Nathan View Post
I thought that's what printf did?
As Adam pointed out, and assuming you're using my serial port driver, it's as simple as this:

Code:
 // first, find out how much data, if any, is present in 
 // serial port 1's received data queue?
 byte_count = Serial_Port_One_Byte_Count();
 
 // have we received any data?
 if(byte_count > 0)
 {
  // we have fresh data, so read each received byte one at a time
  for(j = 0; j < byte_count; j++)
  {
   // get the next data byte
   data = Read_Serial_Port_One();
 
   // send it out the other serial port
   Write_Serial_Port_Two(data);
 
  // work with camera data here
  }
}
-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org