?? typedef.h
字號:
#ifndef _TYPE_H
#define _TYPE_H
#define _KEIL_51
#ifdef _KEIL_51
typedef union
{
unsigned int word;
struct{
unsigned char high;
unsigned char low; /*in Keil_c51 one int value is High::low */
}bytes;
} BYTE_WORD ;
#else
typedef union
{
unsigned int word;
struct{
unsigned char low;
unsigned char high; /*but some oher complier is low::high */
}bytes; /*.eg. tasking XA */
} BYTE_WORD ;
#endif
typedef union
{
unsigned long LONG;
unsigned int word_h; //高16位
unsigned int word_l; //低16位
struct{
unsigned char byte_4;
unsigned char byte_3;
unsigned char byte_2;
unsigned char byte_1;
}bytes;
}LONG_BYTE;
#define UCHAR unsigned char
#define UINT unsigned int
#define ULONG unsigned long
#define BOOL unsigned char
#define uchar unsigned char
#define uint unsigned int
#define ulong unsigned long
#define bool unsigned char
#define true 1
#define false 0
#define TRUE 1
#define FALSE 0
#ifndef NULL
#define NULL (void *)0
#endif
#ifndef null
#define null (void *)0
#endif
#define Clear_bit(Value,bit_num) { (Value) =(Value)& ( ~ ( 1 << (bit_num) ) ); }
#define Set_bit(Value,bit_num) { (Value) =(Value)| ( 1 << (bit_num) ); }
#define Cpl_bit(Value,bit_num) { (Value) =(Value)^ ( 1 << (bit_num) ); }
#define Bit_is_one(Value,bit_num) ( (Value) & (1<< (bit_num) ) )
#define Bit_is_zero(Value,bit_num) ( !( (Value) & ( 1<< (bit_num) ) ) )
#define Max(x,y) ( (x)>(y) ? (x) : (y) )
#define Min(x,y) ( (x)<(y) ? (x) : (y) )
#define LongToBin(n) \
(\
((n >> 21) & 0x80) | \
((n >> 18) & 0x40) | \
((n >> 15) & 0x20) | \
((n >> 12) & 0x10) | \
((n >> 9) & 0x08) | \
((n >> 6) & 0x04) | \
((n >> 3) & 0x02) | \
((n ) & 0x01) \
)
#define Bin(n) LongToBin(0x##n##L)
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -