type.h
来自「三星S3C2460 USB DEVICE /USB HOST 监控代码」· C头文件 代码 · 共 71 行
H
71 行
#ifndef __TYPE_H__
#define __TYPE_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <string.h>
#include <stdio.h>
/**
*\name Primitive types
*@{*/
typedef unsigned char boolean;
typedef signed char int8;
typedef unsigned char uint8;
typedef short int16;
typedef int int32;
typedef unsigned short uint16;
typedef unsigned int uint32;
/**@}*/
#ifdef TRUE
#undef TRUE
#endif
#ifdef FALSE
#undef FALSE
#endif
#define FALSE (0)
#define TRUE (!FALSE)
/*
* Description:
* additional macros
*
* Remarks:
* IGNORE - indicates that the parameter is not used (for expansion)
*/
#define IGNORE(_v) ((void)(_v))
#if 1
#define ASSERT(_p) if(!(_p)) {printf("\nParameter Error : %s, %d\n",__FILE__, __LINE__); \
printf("Press any key\n\n");\
getchar();\
return;}
#else
#define ASSERT(_p)
#endif
/*
* Description:
* Inline functions implemented as macros.
*/
/**\brief The larger of __x and __y */
#define MAX(__x,__y) ((__x)>(__y)?(__x):(__y))
/**\brief The smaller of __x and __y */
#define MIN(__x,__y) ((__x)<(__y)?(__x):(__y))
/**\brief Wait for a period of time (arbitrary units) */
#define apWAIT(__t) { int32 __i=__t; while (__i>0)__i-=1; }
#ifdef __cplusplus
}
#endif
#endif /*__TYPE_H__*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?