printf.h 1 KB
#ifndef	__PRINTF_H__
#define	__PRINTF_H__


//#define UART_PRINTF_FIFO_ENABLE


//#define PRINTF_MAX_WAIT_TIME    (1000 / OS_MSEC_PER_TICK  + 1) //1000ms
#define PRINTF_MAX_WAIT_TIME    ( 500 / OS_MSEC_PER_TICK  + 1) //500ms


void printf_init( void );

/*
 * 		for simple string output, recommend to use puts instread of printf
 * 		puts is much more efficient than printf in this case
 */
int myputs( const char *str );


/*
 * 
		format	=	%type
		type	=	{
						c		-	single byte, char type data
						s		-	single byte string
						S		-	wide/2byte string
						d/D, 	-	signed int
						u/U, 	-	unsigned int
						x, 		-	unsigned hexadecimal, lower case
						X		-	unsigned hexadecimal, upper case
					}

		to print '%', use '%%'
		to change output line, add suffix "\r\n"
		to output str ended with wide character str, use '%S' & add suffix "\0\0"
 * 
 */

int	myprintf( const char *format, ... );
int	myprintf_no_os( const char *format, ... );

int	myprintf_for_usbdev( const char *format, ... );

#endif //__PRINTF_H__