diag.h

来自「Cypress 的VOIP DEMO 研究VOIP终端的朋友可以研究研究」· C头文件 代码 · 共 67 行

H
67
字号
//
// Cypress Semiconductor
// Wireless Audio Example
//

#if !defined(DIAG_H)
#define DIAG_H

//#define USB_DIAG


//#if defined(REMOTE_END)
//#define IF_BUTTON_DOWN		if(!(SW_BIND_Data_ADDR & SW_BIND_MASK))
//#else
//#define IF_BUTTON_DOWN		SW1_Data_ADDR &= ~SW1_MASK;   if((SW1_Data_ADDR & SW1_MASK))
//#endif

#if defined(USB_DIAG)

//
// Send a diagnostic byte with a carriage return on our diagnostic endpoint channel
//
//#pragma fastcall16 DiagSendByte
void DiagSendByte(char dataByte);

//
// Do a single byte send
//
void DiagSendByteLow(char dataByte);


//
// Send a diagnostic string
//
void DiagSendString(const char* pString);

// Send a single byte as hex to the diag stream
void DiagSendHexByte(BYTE hex);

//
// Dump some hex bytes
//
void DiagDumpHex(BYTE *pData, BYTE length);

//
// Polling function - call frequently
//
// 
void DiagPoll(void);


#define ASSERT(cond)		if(cond) {} else { DiagSendString("Assertion"); for(;;); }

#else

#define DiagSendByte(a)
#define DiagSendByteLow(a)
#define DiagSendString(a)
#define DiagSendHexByte(a)
#define DiagDumpHex(p,c)
#define DiagPoll()

#define ASSERT(cond)	

#endif

#endif // !DIAG_H

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?