?? main.lst
字號:
C51 COMPILER V7.08 MAIN 12/26/2003 07:27:16 PAGE 1
C51 COMPILER V7.08, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: C:\Keil708\C51\BIN\C51.EXE main.c LARGE BROWSE DEBUG OBJECTEXTEND
line level source
1
2 #include "uip.h"
3 #include "uip_arch.h"
4 #include "uip_arp.h"
5 #include "slipdev.h"
6 #include "httpd.h"
7
8 #include "my.h"
9 #include "serial.h"
10
11 #include "fs.h"
12 #include "fsdata.h"
13 #include "cgi.h"
14
15 #define BUF ((struct uip_eth_hdr *)&uip_buf[0])
16
17 unsigned char msec=0;//10毫秒鐘
18 unsigned char sec=0;//秒鐘
19 unsigned char min=0;//分鐘
20
21 bit double_second=0;
22
23 sbit tcpled=P1^0;
24
25 //工作在16位定時模式,中斷時間為10毫秒中斷一次,誤差小于千分之1,晶振使用22.1184Mhz
26 void timer0() interrupt 1
27 {
28 1 tl0=9;
29 1 th0=184;
30 1 msec++;
31 1 if(msec==100) //100分頻,就是1秒一次
32 1 {
33 2 msec=0;
34 2 sec++;
35 2 double_second=1;
36 2 if(sec==60)
37 2 {
38 3 sec=0;//每分鐘一次
39 3 min++;
40 3 if(min==60)
41 3 min=0;
42 3 }
43 2 }
44 1 }
45
46 void timer0_init()
47 {
48 1 timer0_mode_16bit;
49 1 th0=0;tl0=0;
50 1 timer0_run;
51 1 }
52
53 void interrupt_init(void)
54 {
55 1 timer2_interrupt_disable;
C51 COMPILER V7.08 MAIN 12/26/2003 07:27:16 PAGE 2
56 1 timer0_interrupt_enable;
57 1 timer1_interrupt_disable;
58 1 int0_interrupt_disable;
59 1 // timer0_priority_high;
60 1 int1_interrupt_disable;
61 1 serial_priority_high;
62 1 serial_interrupt_enable;
63 1 int0_mode_hightolow;
64 1 int0_priority_low;
65 1 }
66
67 /*-----------------------------------------------------------------------------------*/
68 void
69 main(void)
70 {
71 1 u8_t i;
72 1 //u16_t ii;
73 1 // struct fs_file fsfile;
74 1
75 1 /*以下為單片機初始化 */
76 1 timer0_init();/*定時器初始化*/
77 1 serial_init();/*串口初始化*/
78 1 interrupt_init();/*中斷初始化*/
79 1
80 1 putstring("8051 TCP/IP stack and web server running\n");
81 1
82 1 uip_init();
83 1 httpd_init();
84 1
85 1 slipdev_init();
86 1 tcpled = 0;
87 1
88 1 // fs_open("/index.html", &fsfile);
89 1
90 1 modem_request();
91 1 modem_reply();
92 1
93 1 while(1)
94 1 {
95 2 /* Let the tapdev network device driver read an entire IP packet
96 2 into the uip_buf. If it must wait for more than 0.5 seconds, it
97 2 will return with the return value 0. If so, we know that it is
98 2 time to call upon the uip_periodic(). Otherwise, the tapdev has
99 2 received an IP packet that is to be processed by uIP. */
100 2 uip_len = slipdev_read();
101 2 if(uip_len > 0)
102 2 {
103 3 tcpled = 1;
104 3 uip_process(UIP_DATA);
105 3 if(uip_len > 0)
106 3 slipdev_send();
107 3 }
108 2 tcpled = 0;
109 2 if(double_second)
110 2 {
111 3 double_second = 0;
112 3 for(i = 0; i < UIP_CONNS; i++)
113 3 {
114 4 uip_periodic(i);
115 4 /* If the above function invocation resulted in data that
116 4 should be sent out on the network, the global variable
117 4 uip_len is set to a value > 0. */
C51 COMPILER V7.08 MAIN 12/26/2003 07:27:16 PAGE 3
118 4 if(uip_len > 0)
119 4 {
120 5 uip_arp_out();
121 5 slipdev_send();
122 5 }
123 4 }
124 3 }
125 2 }
126 1 }
127 /*-----------------------------------------------------------------------------------*/
128
129
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 261 ----
CONSTANT SIZE = 42 ----
XDATA SIZE = 3 1
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = 1 ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -