把以下内容保存到编程软件的Include目录,并保存为了mytype.h文件. 如果你用的是Keil,这个目录可能就是: Keil\C51\INC
/* http://www.rupeng.com/forum/thread-8057-1-1.html */
#ifndef _MYTYPE_
#define _MYTYPE_
typedef unsigned int uint16;
typedef unsigned int UINT;
typedef unsigned int uint;
typedef unsigned int UINT16;
typedef unsigned int WORD;
typedef unsigned int word;
typedef int int16;
typedef int INT16;
typedef unsigned long uint32;
typedef unsigned long UINT32;
typedef unsigned long DWORD;
typedef unsigned long dword;
typedef long int32;
typedef long INT32;
typedef signed char int8;
typedef signed char INT8;
typedef unsigned char byte;
typedef unsigned char BYTE;
typedef unsigned char uchar;
typedef unsigned char UINT8;
typedef unsigned char uint8;
typedef unsigned char BOOL;
#endif
以后在写程序时只要写上下面语句就行了:
#include 另外,http://hi.baidu.com/tuenhai/照网友红金龙吸味的建议,把编程的源文件只在到工程目录下的src目录,其他如output文件和listing文件保存到output目录.
以下是原文,出处见: http://www.rupeng.com/forum/thread-8057-1-1.html
“从单片机初学者迈向单片机工程师”LED篇第三章模块化编程初识