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

📄 dbgbuf.h

📁 TI的digital motor control lib的源代码。了解TI的编程规范
💻 H
字号:
/* =================================================================================
File name:        DBGBUF.H                     
                    
Originator:	Digital Control Systems Group
			Texas Instruments

Description: 
This file contains type definitions, constants and initializers for
the debug buffer object.
=====================================================================================
 History:
-------------------------------------------------------------------------------------
 9-15-2000	Release	Rev 1.0                                                   
------------------------------------------------------------------------------*/

#ifndef     __DBGBUF_H_
#define     __DBGBUF_H_
/*-----------------------------------------------------------------------------
Define the structure of the DBGBUFFER
-----------------------------------------------------------------------------*/
typedef struct  {   int buf[256];   /* Int array for buffer contents         */ 
                    int index;      /* buffer index                          */ 
                    int (*bufwrite)(); /* Pointer to buffer write function   */
                 } DBGBUFFER;

typedef DBGBUFFER *DBGBUFFER_Handle;

/*------------------------------------------------------------------------------
      Object Initializers
------------------------------------------------------------------------------*/                       
#define BUF_ZEROS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 

#define DBGBUFFER_DEFAULTS { { BUF_ZEROS }, 0, (int (*)(int))dbgbufwrite}

/*------------------------------------------------------------------------------
      Funtion 
------------------------------------------------------------------------------*/                       
                          
void dbgbufwrite(DBGBUFFER_Handle hndl,int elementToAdd)
{
    hndl->buf[hndl->index]=elementToAdd;
    hndl->index++;
    hndl->index=hndl->index&255;
    
    
}

#endif


⌨️ 快捷键说明

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