stm32调试信息库
在开发stm32程序的时候经常需要打印调试信息,该库主要用于方便的显示调试信息,在开发阶段可通过定义USER_MAIN_DEBUG来显示调试信息
运行阶段时只需取消宏定义即可
/*
* @Descripttion: 该库主要用于方便的显示调试信息,在开发阶段可通过定义USER_MAIN_DEBUG来显示调试信息
* @version:
* @Author: GongHaoJing
* @Date: 2021-10-21 22:37:47
* @LastEditors: GongHaoJing
* @LastEditTime: 2021-10-22 20:31:21
* @WWW:: www.gonghaojing.top
*/
/*
* ___====-_ _-====___
* _--^^^#####// \\#####^^^--_
* _-^##########// ( ) \\##########^-_
* -############// |\^^/| \\############-
* _/############// (@::@) \############\_
* /#############(( \\// ))#############\
* -###############\\ (oo) //###############-
* -#################\\ / VV \ //#################-
* -###################\\/ \//###################-
* _#/|##########/\######( /\ )######/\##########|\#_
* |/ |#/\#/\#/\/ \#/\##\ | | /##/\#/ \/\#/\#/\#| \|
* ` |/ V V ` V \#\| | | |/#/ V ' V V \| '
* ` ` ` ` / | | | | \ ' ' ' '
* ( | | | | )
* __\ | | | | /__
* (vvv(VVV)(VVV)vvv)
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* 神兽保佑 永无BUG
*/
/*
* _
*| | ___ __ _
*| |__/ _ \/ _` |
*|____\___/\__, |
* |___/
*
*/
#ifndef __LOG_H
#define __LOG_H
/**
* @brief 该库主要用于方便的显示调试信息,在开发阶段可通过定义USER_MAIN_DEBUG来显示调试信息
*
*/
#define USER_MAIN_DEBUG
#ifdef USER_MAIN_DEBUG
#define user_main_printf(format, ...) printf(format "\r\n", ##__VA_ARGS__)
#define user_main_info(format, ...) printf("[main]info:"format "\r\n", ##__VA_ARGS__)
#define user_main_debug(format, ...) printf("[main]debug:"format "\r\n", ##__VA_ARGS__)
#define user_main_error(format, ...) printf("[main]error:"format "\r\n", ##__VA_ARGS__)
#else
#define user_main_printf(format, ...)
#define user_main_info(format, ...)
#define user_main_debug(format, ...)
#define user_main_error(format, ...)
#endif
#endif