CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

putc(), getc()...

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
bsodmike



Joined: 05 Aug 2006
Posts: 52

View user's profile Send private message Visit poster's website AIM Address MSN Messenger

putc(), getc()...
PostPosted: Wed Aug 30, 2006 12:13 pm     Reply with quote

Quick question, in the event nothing is received does this function timeout? Or does it simply attempt to read the RCREG register, find that it hasn't been loaded and continue?

Was just wondering it no devices were attached, if these would cause the code to halt...but I don't see why putc() would be affected. (both are in ref to async rs232)

Cheers,
Mike
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Aug 30, 2006 12:18 pm     Reply with quote

Quote:
Quick question, in the event nothing is received does this function timeout?

getc() and fgetc() will wait forever, while looking for a character to
come in.
Use kbhit() to check if a character is available, before calling getc() or
fgetc(). Also look at the timed_getc() function in this example file:
c:\program files\picc\examples\ex_tgetc.c
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Wed Aug 30, 2006 12:21 pm     Reply with quote

Quote:

Quick question, in the event nothing is received does this function timeout?


http://www.ccsinfo.com/faq.php?page=getc_timeout


Humberto
bsodmike



Joined: 05 Aug 2006
Posts: 52

View user's profile Send private message Visit poster's website AIM Address MSN Messenger

PostPosted: Thu Aug 31, 2006 12:42 am     Reply with quote

That said putc() isn't affected yea?

Cheers!
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Thu Aug 31, 2006 8:12 am     Reply with quote

Quote:

That said putc() isn't affected yea?


yea

Humberto
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group