View Single Post
  #20   Spotlight this post!  
Unread 05-06-2002, 20:24
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Quote:
does the comment in that code mean for all the stuff you say to do before, to be placed in that function? i'm asking, because it's a bit unclear on that part.
Sorry about that. Only the code that does the actual reading from the serial port and the code that processes the data goes in here. Everything else goes wherever you do the rest of your init stuff. Just make sure you call your init routine before _beginthread. Otherwise, Windows will not be happy.
Basically, it should look like:

void SerialThread(PVOID pvoid){
while(true){
ReadFile(...);
//data-processing code
}
}

If you try something and it doesn't work, feel free to email me the code, and I'd be happy to take a look at it.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php