?? define.h
字號:
#define NULL 0
#define FALSE 0
#define TRUE 1
//定義接收緩沖區(qū)的長度
#define UARTRXLEN 200
#define TELLEN 30
//時間長度不超過4位(0-9999)分鐘
//命令編號
#define LINE 0
//
#define SETUPTEL 1
#define RTEL 2
#define CALLTEL 3
#define GET 4
#define RINGOFF 5
#define QUERY 6
#define NULLACK 7
//------------------------
#define SET_BIT(X,Y) (X|=(1<<Y))
#define CLR_BIT(X,Y) (X&=~(1<<Y))
#define GET_BIT(X,Y) (X&(1<<Y))
#define XOR_BIT(X,Y) (X^=(1<<Y))
//定時
#define timesec 20 //2s
#define time3sec 30
#define LEDON SET_BIT(PORTB,5)
#define LEDOFF CLR_BIT(PORTB,5)
/* Static Variables */
typedef unsigned char uchar;
typedef unsigned int uint;
unsigned char WorkCount; //工作指示
static unsigned char Busybz;
unsigned char *pir; //指針
static unsigned char UART_RXHEAD; //接收計數(shù)器
static unsigned char DealRxUartBz; //串口接收處理標(biāo)志
static unsigned char DealTxUartBz; //串口發(fā)送標(biāo)志
static unsigned char TelBuf[TELLEN+1]; //電話本緩沖區(qū)
//
union
{
uchar Buf[UARTRXLEN]; //定義接收緩沖區(qū)
struct
{
uchar sd[100];
uchar Temp[100];
}ch;
}Uart;
//時間定時器
struct
{
unsigned char Sec; //分鐘計數(shù)器
unsigned int Atd; //拔號定時0-9999分鐘,0為不定時
unsigned int Min; //分鐘
unsigned int Mec; //分
uchar Bz; //毫秒定時到標(biāo)志置1
}Time;
void delay_us(int time)
{
do
{
time--;
}
while (time>1);
}
/* 毫秒級延時程序 */
void delay_ms(unsigned int time)
{
while(time!=NULL)
{
WDR();
delay_us(825);
time--;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -