dbgbuf.h

来自「TI公司24X系列DSP控制无刷直流电机」· C头文件 代码 · 共 58 行

H
58
字号
/* =================================================================================
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.00                                                  
------------------------------------------------------------------------------*/

#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 + =
减小字号Ctrl + -
显示快捷键?