51单片机模块化编程初识

在51单片机C语言编程中,为了提高程序的可移植性,有必要用可移植的变量类型的别名进行编程。 把以下内容保存到编程软件的Include目录,并保存为了mytype.h文件. 如果你用的是Keil,这个目录可能就是:Keil\C51\INC

#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

你可能感兴趣的:(嵌入式系统)