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

📄 cust_debug.h

📁 一个基于windows mobile 的GPS 接受IC 驱动程序。
💻 H
字号:
#ifndef CUST_DEBUG_H__			// {
#define CUST_DEBUG_H__

#include <Dbgapi.h>

//------------------------------------------------------------------------------
//
//  Configure the debugging.
//
//------------------------------------------------------------------------------

#define  DEBUG_GPS_DRIVER
#undef   DEBUG_GPS_DRIVER

//------------------------------------------------------------------------------
//
//  Tune the SPI driver.
//
//------------------------------------------------------------------------------

#define INCREASE_SPI_PRIORITY
#undef  INCREASE_SPI_PRIORITY

#ifdef INCREASE_SPI_PRIORITY
#define OPT_PRIO_MSG    " prio(102)"
#else
#define OPT_PRIO_MSG    " no prio change"
#endif

//------------------------------------------------------------------------------
//
//  SPI done has 3 options and some minor variations:
//
//  1.0)  Interrupts off for a short time; poll with Sleep(0)
//  1.1)  Interrupts off for a short time; poll with Sleep(1)
//  1.2)  Interrupts off for a short time; poll without Sleep
//  2.0)  Interrupts off for a long  time; poll without Sleep
//  3.0)  Interrupts off for a short time; SPI_DONE interrupt.
//
//------------------------------------------------------------------------------

// #define  SCHEME_1_0
// #define  SCHEME_1_1
// #define  SCHEME_1_2
// #define  SCHEME_2_0
#define  SCHEME_3_0

#if     defined(SCHEME_1_0)         // {

#undef  SPI_DONE_INTERRUPT
#define SHORT_INTERRUPT_OFF_TIME
#define SPI_DONE_POLL()   Sleep(0)
#define FAST_POLL

#define OPT_DONE_MSG   "spiDone(1.0) - intrOff(short) Sleep(0)"

#elif   defined(SCHEME_1_1)         // }{

#undef  SPI_DONE_INTERRUPT
#define SHORT_INTERRUPT_OFF_TIME
#define SPI_DONE_POLL() Sleep(1)
#undef  FAST_POLL                   
#define OPT_DONE_MSG   "spiDone(1.1) - intrOff(short) Sleep(1)"

#elif   defined(SCHEME_1_2)         // }{

#undef  SPI_DONE_INTERRUPT
#define SHORT_INTERRUPT_OFF_TIME
#define SPI_DONE_POLL()
#define FAST_POLL
#define OPT_DONE_MSG   "spiDone(1.2) - intrOff(short)"

#elif   defined(SCHEME_2_0)         // }{

#undef  SPI_DONE_INTERRUPT
#undef  SHORT_INTERRUPT_OFF_TIME
#define SPI_DONE_POLL()
#define FAST_POLL
#define OPT_DONE_MSG   "spiDone(2.0) - intrOff(long)

#elif   defined(SCHEME_3_0)         // }{

#define SPI_DONE_INTERRUPT 1
#undef  SHORT_INTERRUPT_OFF_TIME
#define SPI_DONE_POLL()
#define FAST_POLL
#define OPT_DONE_MSG   "spiDone(3.0) - interrupt"

#else   // nothing defined   }{

#error  "Must define a SPI_EXCHANGE scheme"

#endif                              // }

/*******************************************************************************
 *
 *          Debug Control
 *
 *      This code assumes some reasonable low-level logging library is available
 *
 ******************************************************************************/

void glReportTime(void);

#define GL_ERROR(msg) glReportTime(), NKDbgPrintfW msg

#ifdef  DEBUG_GPS_DRIVER
void gl_debug_dump(int line, const TCHAR* msg, const UINT8* pData, int iSize);
#define MSG(fmt)    TEXT(fmt)
#define GL_PRINT(msg) NKDbgPrintfW msg
#define GL_DEBUG_PACKET(msg,pData,iSize)   gl_debug_dump(__LINE__,msg,(const UINT8*) pData,iSize)
#else
#define MSG(fmt)
#define GL_PRINT(msg)
#define GL_DEBUG_PACKET(msg,pData,iSize)
#endif

#define GL_ASSERT(expr)   \
        if (expr) \
        { \
            GL_ERROR((MSG("Assert error " __FILE__ ":%d" #expr"\r\n"), \
                    __LINE__)); \
        } else 

#endif // CUST_DEBUG_H__ }

⌨️ 快捷键说明

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