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

📄 pdebug.h

📁 本程序为ST公司开发的源代码
💻 H
字号:
/******************************************************************************* * *  \par          Change History: * * - BB060425     Improved printf functionality *                - added support to directly use printf *                  (no need to sprintf to buffer than use DEBUG_printf) *                - removed unused DEBUG_printf_func_isr * ****************************************************************************** * * STM CVS Log: * * $Log: pdebug.h,v $ * Revision 1.6  2006/10/25 11:13:20  papp * removed blank lines * * Revision 1.5  2006/09/18 09:55:21  belardi * Corrected CVS keyword usage * * Revision 1.4  2006/09/18 09:22:43  belardi * Added Log CVS keyword into file header * * Revision 1.3  2006/09/15 19:38:34  belardi * Merged the m8_cav2_cm80506_cs3563. * - white-spaces * * ******************************************************************************/#ifndef _DEBUGPR_H_#define _DEBUGPR_H_#include "gendef.h"// configurations#if (0 != HAVE_PRINTF)  #define DEBUG_PRINTF_ENABLED  #define DEBUG_MODULE_PRINTF_ENABLED#endif// note: it only makes sense to enable module-printf's ("DEBUG_MODULE_PRINTF_ENABLED")// when the 'normal' printf's are enabled ("DEBUG_PRINTF_ENABLED")#ifndef DEBUG_PRINTF_ENABLED   #ifdef DEBUG_MODULE_PRINTF_ENABLED      #error "invalid printf-enabling"   #endif#endif/*** -> An unique id number for each debugable module.*/typedef  uint8    DEBUG_MODULE_ID_t;// values for DEBUG_MODULE_ID_t:#define DEBUG_MODULE_ID_OSAL               0#define DEBUG_MODULE_ID_DECODER            1#define DEBUG_MODULE_ID_DSP                2#define DEBUG_MODULE_ID_LOADER             3#define DEBUG_MODULE_ID_TIMER              4#define DEBUG_MODULE_ID_MAIN               5#define DEBUG_MODULE_ID_I2C                6#define DEBUG_MODULE_ID_SERVICE            7#define DEBUG_MODULE_ID_COMMAND            8#define DEBUG_MODULE_ID_MESSAGE            9#define DEBUG_MODULE_ID_PLAYER            10#define DEBUG_MODULE_ID_CAPTURE           11#define DEBUG_MODULE_ID_CONTROLLER        12#define DEBUG_MODULE_ID_TTM               13#define DEBUG_MODULE_ID_SLEDGE            14#define DEBUG_MODULE_ID_TRACKING          15#define DEBUG_MODULE_ID_FOCUS             16#define DEBUG_MODULE_ID_CDTEXT            17#define DEBUG_MODULE_ID_TOC               18#define DEBUG_MODULE_ID_FILESYSTEM        19#define DEBUG_MODULE_ID_SERVO             20// Add a new module-id before DEBUG_ID_LAST and make sure that// DEBUG_ID_LAST is always +1#define DEBUG_ID_LAST                     21/***   print string s with arguments to serial port**   @param    s = string with arguments*   @return   void*   @pre      TRUE*   @post     string printed*/#ifdef DEBUG_PRINTF_ENABLED   #define DEBUG_printf(s) \   do {\      DEBUG_printf_func s; \   } while(0)   extern void dprintf(const char *format, ...);#else   #define DEBUG_printf(s)      do{}while(0)   #define dprintf(s,...)       do{}while(0)#endif // DEBUG_PRINTF_ENABLED#ifdef DEBUG_MODULE_PRINTF_ENABLED   #define DEBUG_module_printf(s) \   do {\      if(DEBUG_is_module_enabled(DEBUG_MODID) != FALSE)\      {\         DEBUG_printf_func s; \      }\   } while(0)#else   #define DEBUG_module_printf(s) do{}while(0)#endif // DEBUG_MODULE_PRINTF_ENABLED// use DEBUG_printf_func() and DEBUG_is_module_enabled()// only via macro's DEBUG_printf() or DEBUG_module_printf() !!!extern void    DEBUG_printf_func (char * str, int size, int length, ...);#ifdef DEBUG_PRINTF_ENABLED   void DEBUG_start(void);   extern void    DEBUG_send(void);   extern void    DEBUG_wait(void);#else   // empty defines!!   #define DEBUG_start() do{}while(0)   #define DEBUG_send() do{}while(0)   #define DEBUG_wait() do{}while(0)#endif#ifdef DEBUG_MODULE_PRINTF_ENABLED   extern t_bool  DEBUG_is_module_enabled(DEBUG_MODULE_ID_t module_id);   extern void    DEBUG_set_debug_info(DEBUG_MODULE_ID_t module_id, t_bool enable);#else   // empty defines!!   #define DEBUG_is_module_enabled(a) do{}while(0)   #define DEBUG_set_debug_info(a,b)  do{}while(0)#endif#ifdef TRACE_DEBUG#include "debug.h"#endif#endif

⌨️ 快捷键说明

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