📄 dprintf.h
字号:
/*----------------------------------------------------------------------------------
*
* COPYRIGHT (c) 2001 by Singing Electrons, Inc. All rights reserved.
*
*
* Module Name : C:\se\adi\hidclass\source\dprintf.h
*
* Description : Function prototypes and defines for dprintf
*
*
* Revision History : At bottom of the file.
*
*---------------------------------------------------------------------------------*/
/*------------------------------------------------------------
* Dprintf, Dprintf1, Dprintf2, Dprintf3
*
* Parameters:
* Same as would be used with printf, execpt
* that used a different function based on the
* number of additional parameters.
*
* Globals Used:
* gDprintfBuffer, gCurrentDprintfBufferIndex
*
* Description:
* This set of macros do a "printf" and store the result
* in a cyclic buffer. Use InitDprintf, and DumpDprintf
* to initialize the cyclic buffer and to dump the contents
* of the cyclic buffer.
*
* Set DPRINTF_SUPPRESS = 1 in order to disable the functionality
* of these routines.
*
* Returns:
* Nothing
*
*------------------------------------------------------------*/
#define DPRINTF_SUPPRESS 0
#if DPRINTF_SUPPRESS
#define Dprintf( a )
#define Dprintf1( a, b )
#define Dprintf2( a, b, c )
#define Dprintf3( a, b, c, d )
#define InitDprintf()
#define DumpDprintf( a )
#else
#define MAX_DPRINTFBUFFER_LEN 64
#define MAX_DPRINTFBUFFER_ENTRIES 400
extern char gDprintfBuffer[MAX_DPRINTFBUFFER_ENTRIES][MAX_DPRINTFBUFFER_LEN];
extern int gCurrentDprintfBufferIndex;
#define Dprintf( a ) \
{\
sprintf (gDprintfBuffer[gCurrentDprintfBufferIndex], a);\
gCurrentDprintfBufferIndex = (gCurrentDprintfBufferIndex + 1) % MAX_DPRINTFBUFFER_ENTRIES;\
}
#define Dprintf1( a, b ) \
{\
sprintf (gDprintfBuffer[gCurrentDprintfBufferIndex], a, b);\
gCurrentDprintfBufferIndex = (gCurrentDprintfBufferIndex + 1) % MAX_DPRINTFBUFFER_ENTRIES;\
}
#define Dprintf2( a, b, c ) \
{\
sprintf (gDprintfBuffer[gCurrentDprintfBufferIndex], a, b, c);\
gCurrentDprintfBufferIndex = (gCurrentDprintfBufferIndex + 1) % MAX_DPRINTFBUFFER_ENTRIES;\
}
#define Dprintf3( a, b, c, d ) \
{\
sprintf (gDprintfBuffer[gCurrentDprintfBufferIndex], a, b, c, d);\
gCurrentDprintfBufferIndex = (gCurrentDprintfBufferIndex + 1) % MAX_DPRINTFBUFFER_ENTRIES;\
}
void InitDprintf (void);
void DumpDprintf (int lastFew);
#endif
/*----------------------------------------------------------------------------------
* $Log: dprintf.h,v $
* Revision 1.1 2003/03/03 18:13:45 Devendra
* First Rev, the device enumerates as Mass Storage Class
*
* Revision 1.1 2003/01/09 01:16:36 Devendra
* First Rev of AudioClass - have the device enumerated as audio device, and the volume control and mute are functional!
*
* Revision 1.2 2003/01/08 01:41:56 Devendra
* - Changes to remove divide operations (to improve DSP cycle utilization).
* - Supressed dprintfs
*
* Revision 1.1 2002/10/31 00:30:59 Devendra
* Moved all files in one folder to avoid IDE related problems.
*
* Revision 1.1 2002/10/22 17:23:40 Devendra
* Rearranged file locations.
*
* Revision 1.2 2002/10/09 17:09:32 Devendra
* - Added support for handling IN endpoints.
* - Added HID descriptors (HID and HID Report)
* - Modified the Interface descriptors to comply to HID Class Spec.
* - Added functionality to use the push-buttons on the Eagle-35 as a mouse (for buttons as well as for movement).
* - The device is now a fully functioning USB Mouse!
*
* Revision 1.1 2002/10/08 20:44:35 Devendra
* - Separated the printf logging to a different c module.
*
*
*---------------------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -