📄 main.lst
字号:
C51 COMPILER V7.10 MAIN 09/03/2004 14:33:45 PAGE 1
C51 COMPILER V7.10, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: d:\Keil\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.10 MAIN 09/03/2004 14:33:45 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 /*以下为单片机初始化 */
77 1 timer0_init();/*定时器初始化*/
78 1 serial_init();/*串口初始化*/
79 1 interrupt_init();/*中断初始化*/
80 1
81 1 putstring("8051 TCP/IP stack and web server running\n");
82 1
83 1 uip_init();
84 1 httpd_init();
85 1
86 1 slipdev_init();
87 1 tcpled = 0;
88 1
89 1 // fs_open("/index.html", &fsfile);
90 1
91 1 modem_request();
92 1 modem_reply();
93 1
94 1 while(1)
95 1 {
96 2
97 2 if(modermflag) {modem_reply();}
98 2 else {
99 3 /* Let the tapdev network device driver read an entire IP packet
100 3 into the uip_buf. If it must wait for more than 0.5 seconds, it
101 3 will return with the return value 0. If so, we know that it is
102 3 time to call upon the uip_periodic(). Otherwise, the tapdev has
103 3 received an IP packet that is to be processed by uIP. */
104 3 uip_len = slipdev_read();
105 3 if(uip_len > 0)
106 3 {
107 4 tcpled = 1;
108 4 uip_process(UIP_DATA);
109 4 if(uip_len > 0)
110 4 slipdev_send();
111 4 }
112 3 tcpled = 0;
113 3 if(double_second)
114 3 {
115 4 double_second = 0;
116 4 for(i = 0; i < UIP_CONNS; i++)
117 4 {
C51 COMPILER V7.10 MAIN 09/03/2004 14:33:45 PAGE 3
118 5 uip_periodic(i);
119 5 /* If the above function invocation resulted in data that
120 5 should be sent out on the network, the global variable
121 5 uip_len is set to a value > 0. */
122 5 if(uip_len > 0)
123 5 {
124 6 uip_arp_out();
125 6 slipdev_send();
126 6 }
127 5 }
128 4 }
129 3 }
130 2 }//else of modemflag
131 1 }
132 /*-----------------------------------------------------------------------------------*/
133
134
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 271 ----
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
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -