View previous topic :: View next topic |
Author |
Message |
Lampus
Joined: 20 Sep 2010 Posts: 3
|
How to use printf without #USE RS232? |
Posted: Mon Sep 20, 2010 5:15 am |
|
|
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
|
|
Posted: Mon Sep 20, 2010 10:05 am |
|
|
Printf(your_function_name,"print format string",variables);
Best Wishes |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Sep 20, 2010 10:07 am |
|
|
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.
|
|
|
|
|