/***********************************************************

     	SERIAL_STDIO.C
      Z-World, 2002

      Demonstration of redirection of STDIO output from
      Dynamic C's STDIO window to a serial port (this
      feature was added in Dynamic C 7.25).

      NOTE: these macros are designed for debugging use only!
		They allow printf, putchar, and puts to be redirected
		to the serial ports for viewing in run mode -- these
		macros are not designed to be a standard part of a
		Dynamic C program.
      
      The output of the printf function can be redirected
      to any of the serial ports by adding ONE of the
      following lines to your program:

				#define	STDIO_DEBUG_SERIAL	SADR
				#define	STDIO_DEBUG_SERIAL	SBDR
				#define	STDIO_DEBUG_SERIAL	SCDR
				#define	STDIO_DEBUG_SERIAL	SDDR

		Then specify the desired baud rate with a define like
		the following:

				#define	STDIO_DEBUG_BAUD	57600
	
		Many PC-based terminal programs expect a carriage return
		as well as a newline character at the end of each line.
		A carriage return ('\r') can be added to each linefeed ('\n')
		in a printed string by adding the following line:

				#define	STDIO_DEBUG_ADDCR
								      
************************************************************/

// Add these line to redirect printf output at 57600 baud
// to serial port B.

#define	STDIO_DEBUG_SERIAL	SBDR
#define	STDIO_DEBUG_BAUD		57600

// Add this line to add carriage returns ('\r') to each newline
// char ('\n') when sending printf output to a serial port.

#define	STDIO_DEBUG_ADDCR


main()
{
	printf("This is a test of printf redirect.\n");
	printf("this is the second line of the test.\n");
}
