?? general.h
字號:
#include "reg51.h"
//#include "absacc.h"
//#include "stdio.h"
#include "intrins.h"
//常用頭文件
#include "string.h"
//#include "ctype.h"
//#include "rtx51tny.h"
#include "delay.h"
//數據類型聲明
#define uchar unsigned char
#define uint unsigned int
//定義常量
#define TRUE 1
#define FALSE 0
//定義鍵盤掃描碼(14個)
#define NUM1 0x00 //0 L1 C1
#define NUM2 0x01 //1 L1 C2
#define NUM3 0x02 //2 L1 C3
#define BN_PGUP 0x03 //3 L1 C4
#define NUM4 0x04 //4 L2 C1
#define NUM5 0x05 //5 L2 C2
#define NUM6 0x06 //6 L2 C3
#define BN_PGDN 0x07 //7 L2 C4
#define NUM7 0x08 //8 L3 C1
#define NUM8 0x09 //9 L3 C2
#define NUM9 0x0a //10 L3 C3
#define NUM0 0x0b //11 L3 C4
#define BN_ESC 0x0e //14 L4 C3
#define BN_ENT 0x0f //15 L4 C4
//預定義字符類顯示
#define DEG '^'
#define MIN '/'
#define SEC '"'
#define SPACE ' '
//幀結構的預定義
#define FR_STX 0x40 //幀頭標志 '@'
#define FR_ETX 0x23 //幀尾標志 '#'
//#define FR_SPACE 0x30 //空標志 '0'
//#define FR_ERR1 0x31 //錯誤標志1, '1'
//#define FR_ERR2 0x32 //錯誤標志2 '2'
//幀類型的預定義
//Master(Cmd3種,Repoert3種),Slave
#define FR_Start 0x73 //幀類型 開始采集程序 's'
#define FR_Swing 0x67 //幀類型 開始標定程序 'g' 兼做結果
#define FR_Cancel 0x65 //幀類型 停止采集程序 'e' ,也作為DSP報錯幀(+錯誤碼)
#define FR_Para 0x70 //幀類型 查詢參數 'p'
#define FR_Roger 0x79 //幀類型 正確應答or收到 'y'
#define FR_OMT 0x6e //幀類型 要求重新應答 'n'
#define FR_Quit 0x71 //幀類型 退出通信 'q'
//Slave(Reply6種)
#define FR_Cursor 0x64 //幀類型 光標位置 'd'
#define FR_Result 0x72 //幀類型 計算結果 'r'
#define FR_Swing 0x67 //幀類型 標定結果 'g'
#define FR_A 0x61 //幀類型 儀器常數 'a'
#define FR_L 0x6c //幀類型 緯度 'l'
#define FR_C 0x63 //幀類型 比例系數C 'c'
#define FR_P 0x6d //幀類型 周期個數 'm'
#define FR_Z 0x7a //幀類型 中天位置 'z'
//參數數組大小
#define PLEN 2 //周期個數
#define ALEN 7 //儀器常數
#define LLEN 3 //緯度
#define CLEN 4 //比例系數C
#define ZLEN 4 //中天位置
//IO口定義
sbit SPK=P1^4; //蜂鳴器
sbit DQ=P1^3; //DS18b20
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -