/****************************************************************************** 版权所有: 文件名称: rt_printf.h 文件版本: 01.01 创建作者: sunxi 创建日期: 2020-06-18 功能说明: 实时微系统调试输出接口 其它说明: 修改记录: */ #ifndef _RT_PRINTF_H #define _RT_PRINTF_H /*------------------------------- 头文件 -------------------------------------- */ #include #include /*------------------------------- 宏定义 -------------------------------------- */ #define RT_PRINTF_POSITION() rt_printf("%s:%d\r\n",__FUNCTION__,__LINE__) /*------------------------------ 类型结构 ------------------------------------- */ //sunxi for history typedef struct { unsigned ms:16; unsigned min:6; unsigned :2; unsigned hour:5; unsigned :3; unsigned day:5; unsigned week:3; unsigned month:4; unsigned :4; unsigned year:7; unsigned :1; }CP56_TIME2A_T; typedef union { unsigned char a_time[7]; CP56_TIME2A_T time_t; }CP56_TIME2A; /*------------------------------ 函数声明 ------------------------------------- */ // sunxi 20200810 int rt_printf_init(void); // sunxi 20200810 int rt_printf_exit(void); int rt_printf_fifo_get(int is_net); //int rt_printf_time(const char *fmt, ...); void rt_printf_time2(struct timespec ts); void print_mem(char *name,void * addr,unsigned int len); void print_mem_time(char *name,void * addr,unsigned int len); void print_msg(char *name,void * addr,unsigned int len); int myprintf(const char *fmt, ...); void co_printf(const char *fp,const int line); #define rt_printf_time(fmt,...)\ co_printf(__FILE__,__LINE__);\ myprintf(fmt,##__VA_ARGS__);\ int rt_printf(const char *fmt, ...); /****************************************************************************** 函数名称: rt_printf_init 函数版本: 01.01 创建作者: sunxi 创建日期: 2022-5-31 函数说明: 初始化. 参数说明: 无 返回值: 成功返回0, 失败返回-1 修改记录: */ int rt_printf_init(void); /****************************************************************************** 函数名称: rt_printf_exit 函数版本: 01.01 创建作者: sunxi 创建日期: 2022-5-31 函数说明: 反初始化. 参数说明: 无 返回值: 总是返回0. 修改记录: */ int rt_printf_exit(void); /*------------------------------ 文件结束 ------------------------------------- */ #endif // sunxi 20180627