Files
BLV_C1F_Module/BasicCode/Drive/USART/DBG.h

61 lines
1.8 KiB
C
Raw Normal View History

#ifndef _DEBUG__H_
#define _DEBUG__H_
#include "CH57x_common.h"
/* DEBUG log function. DEBUG printf() <20><><EFBFBD>ض<EFBFBD><D8B6><EFBFBD>*/
#ifndef DBG_LOG_EN
#define DBG_LOG_EN 1 //DEBUG LOG <20><><EFBFBD><EFBFBD><EFBFBD>ܿ<EFBFBD><DCBF><EFBFBD>
#endif
#define DBG_Particular_EN 1 //<2F><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD> -- <20><><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>
#define DBG_NET_LOG_EN 1 //<2F><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ʼ״̬*/
#define DBG_OPT_ActCond_STATUS 0 //<2F><><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>
#define DBG_OPT_MQTT_STATUS 0 //MQTT<54><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>
#define DBG_OPT_Debug_STATUS 0 //<2F><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>
#define DBG_OPT_LOGIC_STATUS 0 //<2F>߼<EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>
#define DBG_OPT_DEVICE_STATUS 0 //<2F><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>
#define DBG_OPT_NET_STATUS 0 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>
#define DBG_OPT_SYS_STATUS 0 //ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ*/
#define DBG_BIT_ActCond_STATUS_bit 6
#define DBG_BIT_MQTT_STATUS_bit 5
#define DBG_BIT_Debug_STATUS_bit 4
#define DBG_BIT_LOGIC_STATUS_bit 3
#define DBG_BIT_DEVICE_STATUS_bit 2
#define DBG_BIT_NET_STATUS_bit 1
#define DBG_BIT_SYS_STATUS_bit 0
#ifdef DBG_LOG_EN
#define DBG_Printf(...) printf(__VA_ARGS__)
#else
#define DBG_Printf(...)
#endif
#ifdef DBG_Particular_EN
#define DBG_log(...) {DBG_Printf("%s %s-%d :",__FILE__,__func__,__LINE__);DBG_Printf(__VA_ARGS__);}
#else
#define DBG_log(...) DBG_Printf(__VA_ARGS__)
#endif
#define DBG_INFO(msg) DBG_Printf("%s %s-%d :%s",__FILE__,__func__,__LINE__,msg)
#ifdef DBG_NET_LOG_EN
#define DBG_NET_log(...) DBG_Printf(__VA_ARGS__)
#else
#define DBG_NET_log(...)
#endif
extern uint32_t Dbg_Switch;
void Dbg_NoTick_Print(int DbgOptBit ,const char *cmd, ...);
void Dbg_Print(int DbgOptBit ,const char *cmd, ...);
void Dbg_Println(int DbgOptBit ,const char *cmd, ...);
void Dbg_Print_Buff(int DbgOptBit ,const char *cmd ,uint8_t *buff,uint32_t len);
#endif