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 CCS Technical Support

fprintf(DEBUG,...) vs. printf("xxx \r\n");

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







fprintf(DEBUG,...) vs. printf("xxx \r\n");
PostPosted: Wed Mar 09, 2005 5:55 pm     Reply with quote

What is this "DEBUG" argument? Is this a CCS ICDU40-specific thing?

I use a MAX232 and simply do a printf("my string\r\n");

Furthermore, is there a way to avoid using so many printf() statements everywhere? Maybe i should just use sprintf and call one function where the only printf function calll resides.

-Mike
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Wed Mar 09, 2005 6:19 pm     Reply with quote

fprintf() allows you to direct the output to a certain stream instead of printf which should do it to the last stream. DEBUG is nothing more than a stream identifier used in the #use rs232 statement.
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Thu Mar 10, 2005 8:34 am     Reply with quote

#use rs232(DEBUGGER)
DEBUGGER directs the chars out via the CCS ICSP connections that go to e.g. portB and then onto the terminal window that is part of the CCS debugger IDE. An add on level shifter ( ex MAX232 ) is not needed since the data is transferred via the ICD link cable ( e.g. in the case of ICDU-40 the transfer is via USB). With that said it is no different than any other stream directive.
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