From: Black, M. <Michael.Black@EssexCorp.com> - 2007-06-26 11:36:04
|
My point is that you may NEVER get what you want if for, whatever reason, the atimega doesn't send the "1" you expect. It may not send anything at all (like if the connector falls off). That's why the timeout loop is what I would do. Otherwise your program will appear to hang and you won't know why. You can then decide what you want to do on a timeout -- start all over again -- or keep trying ad nauseam -- in either case you can print out an error message on the console to let you know what's happening. You just need to use a non-blocking read instead of the blocking read. ___________________ Michael D. Black Essex bl...@es... -----Original Message----- From: gum...@li... [mailto:gum...@li...] On Behalf Of Demetris Zavorotnichenko Sent: Tuesday, June 26, 2007 6:22 AM To: 'General mailing list for gumstix users.' Subject: Re: [Gumstix-users] Serial Code Question I don't really mind if the process sucks all the CPU since I am not doing anything else anyway intill the Initialization is complete. So wouldn't that be OK if I would do a=20 While=20 { } Loop until I get what I want ? I mean in the future I could just put a "Please" wait window and just wait for something to finish. Wouldn't that work ? ------------------------------------------------------------------------ - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ gumstix-users mailing list gum...@li... https://lists.sourceforge.net/lists/listinfo/gumstix-users =20 =20 =20 =20 =20 =20 =20 This electronic message and any files transmitted with it contain = information which may be privileged and/or proprietary. The information = is intended for use solely by the intended recipient(s). If you are not = the intended recipient, be aware that any disclosure, copying, = distribution or use of this information is prohibited. If you have = received this electronic message in error, please advise the sender by = reply email or by telephone (301-939-7000) and delete the message. |