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

How to use printf without #USE RS232?

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



Joined: 20 Sep 2010
Posts: 3

View user's profile Send private message

How to use printf without #USE RS232?
PostPosted: Mon Sep 20, 2010 5:15 am     Reply with quote

Hi, everyone...
I realized custom void putch(char c) and char getch() functions for rs232 with hardware flow control (using RTS and CTS signals).
Can I redirect printf() to work with my functions?
I already do this for sdcc, but i don't know how do this for ccs.
Thank you for your attention.
Ttelmah



Joined: 11 Mar 2010
Posts: 19504

View user's profile Send private message

PostPosted: Mon Sep 20, 2010 10:05 am     Reply with quote

Printf(your_function_name,"print format string",variables);

Best Wishes
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Sep 20, 2010 10:07 am     Reply with quote

Quote:
Can I redirect printf() to work with my functions?

Download the CCS compiler manual.
http://www.ccsinfo.com/downloads/ccs_c_manual.pdf
Look in the section on printf, and read about the 'fname' parameter:
Quote:
printf (fname, cstring, values...)


Also look in the Readme.txt file for vs. 4.112 of the compiler.
It offers a new additional way to do it:
Quote:

#USE RS232 now accepts CALL_PUTC=, CALL_GETC= and CALL_KBHIT= to use user defined functions for these functions.
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