⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 debug.h

📁 这个一个FS8610相关的源码,质量很好啊
💻 H
字号:
/**
 * \addtogroup t4arch
 * @{
 */

/**
 * \addtogroup debug UART print utilites for debug
 * @{
 * Define Debug output for various layer.
 * 
 * Debug Useage:
 * \n The parameter c must include a pair of brackets.
 * \n A printf example: 
 * \code
 *                    printf("This is an example!\n\r");
 * \endcode
 *  When you use DBGOUT, it should be:
 * \code
 *                    DBGOUT(("This is an example!\n\r"));
 * \endcode
 */

/**
 * \file debug.h
 * \brief Debug Function Defination.
 */

/*
******************************************************************************
*
Copyright (c) 2006 FameG Shanghai, Inc. All rights reserved.
*
This is unpublished proprietary source code of FameG Shanghai, Inc.
*
The copyright notice above does not evidence any actual or intended
*
publication of such source code.
******************************************************************************
*/
/*
******************************************************************************
*
Project: T4 Hardware TCP/IP
*
Filename: debug.h
*
Date: 28/02/06
*
Purpose: Debug Function Defination 
*
Author: Xiaofei Rui
******************************************************************************
*/

#ifndef __DEBUG_H__
#define __DEBUG_H__

#include <stdio.h>
#include "kernel/system.h"


#define DEBUG           0   /**< Debug Controlling on Global Level 
                             * \hideinitializer */

#define MAC_DEBUG       0   /**< enable/disable Ethernet-level debug messages 
                             * \hideinitializer */
#define IP_DEBUG        0   /**< enable/disable IP-level debug messages 
                             * \hideinitializer */
#define ICMP_DEBUG      0   /**< enable/disable ICMP-level debug messages 
                             * \hideinitializer */
#define ARP_DEBUG       0   /**< enable/disable ARP-level debug messages 
                             * \hideinitializer */
#define PPPOE_DEBUG     0   /**< enable/disable PPPoE-level debug messages 
                             * \hideinitializer */
#define SOCKET_DEBUG    0   /**< enable/disable SOCKET-level debug messages 
                             * \hideinitializer */
#define TIMERS_DEBUG    0   /**< enable/disable Timer-level debug messages 
                             * \hideinitializer */

#define DMA_DEBUG         0   /**< enable/disable DMA debug messages 
                             * \hideinitializer */

#define SMTP_DEBUG         0   /**< enable/disable SMTP debug messages 
                             * \hideinitializer */

#define TFTP_DEBUG         0   /**< enable/disable TFTP CLIENT debug messages 
                             * \hideinitializer */


#define MR8910_DEBUG         0   /**< enable/disable MR910 module debug messages 
                             * \hideinitializer */
#define WEBCAM_DEBUG    0

/// @cond DOXYGEN_SKIP
/****************************************************/
/* Do not modify following if not needed			*/
/****************************************************/
#if DEBUG == 1
//#define	DBGOUT(c);        	{DISABLE_IRQ(); TI = 1; printf c; ENABLE_IRQ();}
#define	DBGOUT(c);        	{ TI = 1; printf c; TI = 0;}

#if MAC_DEBUG == 1
#define	MAC_DBGOUT(c);   	{ TI = 1; printf c; TI = 0;}
#else
#define MAC_DBGOUT(c);
#endif

#if IP_DEBUG == 1
#define	IP_DBGOUT(c);    	{ TI = 1; printf c; TI = 0;}
#else
#define IP_DBGOUT(c); 
#endif

#if ICMP_DEBUG == 1
#define	ICMP_DBGOUT(c)   	{ TI = 1; printf c; TI = 0;}
#else
#define ICMP_DBGOUT(c); 
#endif

#if ARP_DEBUG == 1
#define	ARP_DBGOUT(c);	    { TI = 1; printf c; TI = 0;}
#else
#define ARP_DBGOUT(c); 
#endif

#if SOCKET_DEBUG == 1
#define	SOCKET_DBGOUT(c);   { TI = 1; printf c; TI = 0;}
#else
#define SOCKET_DBGOUT(c); 
#endif

#if PPPOE_DEBUG == 1
#define	PPPOE_DBGOUT(c);	{ TI = 1; printf c; TI = 0;}
#else
#define PPPOE_DBGOUT(c);
#endif

#if TIMERS_DEBUG == 1
#define	TMR_DBGOUT(c);	    { TI = 1; printf c; TI = 0;}
#else
#define	TMR_DBGOUT(c);
#endif

#if DMA_DEBUG == 1
#define	DMA_DBGOUT(c);	    { TI = 1; printf c; TI = 0;}
#else
#define	DMA_DBGOUT(c);
#endif

#if SMTP_DEBUG == 1
#define	SMTP_DBGOUT(c);	   { TI = 1; printf c; TI = 0;}
#else
#define	SMTP_DBGOUT(c);
#endif

#if TFTP_DEBUG == 1
#define	TFTP_DBGOUT(c);	   { TI = 1; printf c; TI = 0;}
#else
#define	TFTP_DBGOUT(c);
#endif

#if MR8910_DEBUG == 1
#define	MR8910_DBGOUT(c);	    { TI = 1; printf c; TI = 0;}
#else
#define	MR8910_DBGOUT(c);
#endif

#if WEBCAM_DEBUG == 1
#define WEBCAM_DBGOUT(c);		{ TI = 1; printf c; TI = 0;}
#else
#define WEBCAM_DBGOUT(c);
#endif

#else   /* DEBUG == 0 */
/* turned off debug printf*/
#define DBGOUT(c); 

#define MAC_DBGOUT(c); 
#define IP_DBGOUT(c); 
#define ICMP_DBGOUT(c); 
#define ARP_DBGOUT(c); 
#define SOCKET_DBGOUT(c); 
#define PPPOE_DBGOUT(c); 
#define	TMR_DBGOUT(c);
#define	DMA_DBGOUT(c);
#define	SMTP_DBGOUT(c);
#define	TFTP_DBGOUT(c);
#define	MR8910_DBGOUT(c);

#endif /* DEBUG == 1 */

/* FPGA board 7-segment LED display, Added by Stony@2006-05-28 */
#define	P1_LED_SYMBOL_1	0xCF		//'1'
#define	P1_LED_SYMBOL_2	0xA4		//'2'
#define	P1_LED_SYMBOL_3	0xB0		//'3'
#define	P1_LED_SYMBOL_4	0x99		//'4'
#define	P1_LED_SYMBOL_5	0x92		//'5'
#define	P1_LED_SYMBOL_6	0x82		//'6'
#define	P1_LED_SYMBOL_7	0xF8		//'7'
#define	P1_LED_SYMBOL_8	0x80		//'8'
#define	P1_LED_SYMBOL_9	0x90		//'9'
#define	P1_LED_SYMBOL_0	0xC0		//'0'
#define	P1_LED_SYMBOL_P	0x8C		//'P', Pass
#define 	P1_LED_SYMBOL_E	0x86		//'E', Error

/// @endcond

#endif /*__DEBUG_H__*/

/** @} */
/** @} */

⌨️ 快捷键说明

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