?? global.c
字號:
/*********************************************************************
* Copright(c) 2003,廣州周立功單片機發(fā)展有限公司
* All rights reserved.
* http://www.zlgmcu.com
*
*文件名稱: global.c
*文件標識:
*摘 要: 定義全局變量,網絡底層驅動程序,校驗和計算,處理器相關設定
*
*當前版本: V1.0
*作 者: zlgmcu
*完成日期: 2003.2.27
*
*
*
*********************************************************************/
/*********************************************************************
* 公共變量定義
*
********************************************************************/
//#include "uart.c"
#define GLOBAL_GLOBALS
#include "net_cfg.h"
/****************************************************************/
uchar Ping_Count; //ping的次數,決定本地回顯次數
uchar Ping_IP_TTL=0; //ping的主機的物理地址生存時間,單位分鐘,為0表示IP地址沒有解析
uchar Gateway_IP_TTL=0 ; //網關IP地址的物理地址生存時間,單位分鐘
//=0表示還沒有解析,<5分鐘時需要更新
uchar Udp_Count;
uchar Msec=0; //10毫秒
uchar Sec=0; //秒鐘
uchar Min=0; //分鐘
uchar i=0;
uchar bnry; //讀芯片RAM指針
uchar curr; //寫芯片RAM指針
//uchar Tcp_Drop_Count=0; //用于關閉tcp連接的計數
uchar RtTime=20; //重發(fā)時間
uchar Tcp_Drop_Count=0; //用于關閉tcp連接的計數
uint FrameIndex=0; //IP包的序列號
uint ComRxdRead=0; //串口接收讀指針
uint ComTxdRead=0; //串口發(fā)送讀指針
uint ComRxdWrite=0; //串口接收寫指針
uint ComTxdWrite=0; //串口發(fā)送寫指針
bit ComTxdBufempty=0; //串口發(fā)送緩沖區(qū)數據空的標志
bit Tx_Buff_Sel=0; //芯片的發(fā)送緩沖區(qū)選擇
bit BiSecond; //兩秒時,該標志置1
bit Tcp_Timeout=0; //TCP超時標志,定時器0中斷中將該標志置位
bit TcpConnected=0; //TCP連接建立標志
uchar code MacID[6]=MY_MAC_ID;//將RTL8019的物理地址存儲在程序空間中
uchar code HexTable[]={"0123456789ABCDEF"}; //為ascii->hex的轉換表
xdata uchar Command_Buf[COMMAND_BUFF_SIZE];//命令緩沖區(qū)
xdata unsigned char IpStr[16];
xdata unsigned char PortStr[5];
xdata struct Socket_Type TCP1024;
xdata uchar ComRxdBuf[COM_RXD_BUFF_SIZE]; //串口的接收緩沖區(qū)
xdata uchar ComTxdBuf[COM_TXD_BUFF_SIZE]; //串口的發(fā)送緩沖區(qū)
xdata union Netcard RxdNetBuff; //數據接收緩沖區(qū)
xdata union Netcard TxdNetBuff; //數據發(fā)送緩沖區(qū)
xdata union Netcard Resend_Buff;
xdata union Ethernet_Address_Type My_MAC ; //本機的物理地址
xdata union Ethernet_Address_Type Gateway_MAC; //網關的物理地址
xdata union Ethernet_Address_Type Ping_MAC; //PING的物理地址
xdata union Ip_Address_Type My_Ip_Address ; //本機IP地址
xdata union Ip_Address_Type Gateway_Ip_Address; //網關IP地址
xdata union Ip_Address_Type Mask_Ip_Address; //子網掩碼
xdata union Ip_Address_Type Ping_Ip_Address; //保存PING命令的目的主機的物理地址
union u RemotePort;
union w CrcTemp;
/**********************************************************************
**函數原型: void delay_ms(uint ms_number)
**入口參數:
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -