?? const.h
字號:
/************************************************************************************
* Copyright (c) 2004,西安銘朗電子科技有限責任公司
* All rights reserved.
*
* 文件名稱: const.h
* 文件標識: none
* 適用器件: C8051F040
*
* 摘 要: 本文件是針對 keil C51 環境下對常量和自定義變量的全局說明;
*
* 當前版本:1.2
* 作 者:李林利
* 完成日期:2005年6月19日
*
* 當前版本:1.1
* 作 者:盧 陽
* 完成日期:2004年11月14日
*
* 歷史版本:1.0
* 原作者 : 李林利
* 完成日期:2004年5月1日
*
* 歷史版本:0.9
* 原作者 : 李林利
* 完成日期:2004年1月1日
*************************************************************************************/
#ifndef null
#define null 0
#endif
#ifndef false
#define false 0
#endif
#ifndef true
#define true 1
#endif
#ifndef bool
#define bool unsigned char
#endif
// Disable all interrupts
#define DISABLE_INTERRUPTS EA = 0
// Enable all interrupts
#define ENABLE_INTERRUPTS EA = 1
typedef unsigned char INT8U; /* Unsigned 8 bit quantity */
typedef signed char INT8S; /* Signed 8 bit quantity */
typedef unsigned int INT16U; /* Unsigned 16 bit quantity */
typedef signed int INT16S; /* Signed 16 bit quantity */
typedef unsigned long INT32U; /* Unsigned 32 bit quantity */
typedef signed long INT32S; /* Signed 32 bit quantity */
typedef float FP32; /* Single precision floating point */
typedef double FP64; /* Double precision floating point */
#define BYTE INT8U
#define WORD INT16U
#define DWORD INT32U
#define R_BYTE unsigned char data
#define I_BYTE unsigned char idata
#define P_BYTE unsigned char pdata
#define X_BYTE unsigned char xdata
#define R_WORD unsigned int data
#define I_WORD unsigned int idata
#define P_WORD unsigned int pdata
#define X_WORD unsigned int xdata
#define R_DWORD unsigned long data
#define I_DWORD unsigned long idata
#define P_DWORD unsigned long pdata
#define X_DWORD unsigned long xdata
#define C_BYTE unsigned char code
#define C_WORD unsigned int code
#define C_DWORD unsigned long code
typedef union {
struct
{
INT8U Type;
INT8U Index;
} Descriptor;
struct
{
INT8U c3; // MSB for 8051 Keil C
INT8U c2;
INT8U c1;
INT8U c0; // LSB for 8051 Keil C
} chars;
struct
{
INT16U i1; // MSW for 8051 keil C
INT16U i0; // LSW for 8051 Keil C
} ints;
INT32U u0;
} FLEXI_INT32;
typedef union
{
struct
{
INT8U c1; // MSB for 8051 Keil C
INT8U c0; // LSB for 8051 Keil C
} chars;
INT16U u0;
} FLEXI_INT16;//, * PFLEXI_INT16;
#define WDT_CLOSE EA=0; WDTCN=0xde; WDTCN=0xad; EA=1;
#define WDT_OPEN WDTCN = 0xff;
#define WDT_CLR WDTCN = 0xa5;
/***********************************************************************************/
// 文件結束
/***********************************************************************************/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -