📄 egi_stat.lst
字号:
C51 COMPILER V7.50 EGI_STAT 10/12/2006 15:31:45 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE EGI_STAT
OBJECT MODULE PLACED IN .\Release\Egi_stat.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE egi_funcs\Egi_stat.c LARGE OPTIMIZE(9,SIZE) BROWSE ORDER MODDP2 INCDIR(.\WE
-BPAGE\;..\..\inc\) DEBUG OBJECTEXTEND PRINT(.\Release\Egi_stat.lst) OBJECT(.\Release\Egi_stat.obj)
line level source
1 /*
2 *
3 * Egi_stat.c
4 *
5 * Part of the Myson Century CS620X demo program.
6 *
7 * Authors: LY Lin, WM Wang, IJ Chen, WH Lee
8 *
9 * Egi_stat.c contains HTTP status.cgi callback routine.
10 *
11 * This program was developed using the Keil 8051 C uVision 2 system.
12 * The Keil compiler MUST be used if working with Myson Century supplied
13 * firmware.
14 *
15 *
16 *
17 */
18
19
20 #include <stdio.h>
21 #include <string.h>
22 #include <ctype.h>
23
24 #include "ether.h"
25 #include "netutil.h"
26 #include "ip.h"
27 #include "tcp.h"
28 #include "config.h"
29 #include "http.h"
30 #include "status.h"
31
32 extern xdata unsigned char PORTB_EN;
33 extern xdata unsigned char PORTB;
34
35 sfr P1=0x90;
36 /************************************************************************
37 /* Function Name : status_resp *
38 /* *
39 /* Arguments : *
40 /* TSOCK xdata *ts: Point to TSOCK. *
41 /* char xdata *str: Point to egi comment tag string(<!--#) *
42 /* or NULL if this function is first time be *
43 /* called. *
44 /* *
45 /* Return : *
46 /* None *
47 /* Comment : *
48 /* This function is a callback function for status.cgi. First, *
49 /* this function be called on the start of status.cgi with *
50 /* str=NULL. Then when webpage meet egi comment tag(<!--#) , *
51 /* this function will be called , the 'str' is point to egi *
52 /* comment tag. *
53 /* *
54 /************************************************************************/
C51 COMPILER V7.50 EGI_STAT 10/12/2006 15:31:45 PAGE 2
55 void status_resp(TSOCK xdata *ts, char xdata *str)
56 {
57 1 APPDATA *adp;
58 1 unsigned char input, i;
59 1 int which_bit, mask;
60 1 RAM_WEB_PAGE *ptr_web_page;
61 1
62 1 adp = (APPDATA *)ts->app;
63 1 if (!str) /*The egi function is called the first time.*/
64 1 {/*Init app for status.cgi. */
65 2 adp->egi = status_resp;
66 2 ptr_web_page = search_get_web_page ("status.cgi");
67 2 adp->in = ptr_web_page->RAM_WEB_PAGE_DATA;
68 2 adp->file_length = ptr_web_page->RAM_WEB_PAGE_LEN;
69 2 }
70 1 else/*Egi comment tag.*/
71 1 {
72 2 str += EGI_STARTLEN;/*Skip "<!--#" .*/
73 2
74 2 /*Egi web page needs P1 led data.*/
75 2 if (!strncmp(str, "$led", 4) && isdigit(*(str+4)))
76 2 {
77 3 which_bit = *(str+4) - '0';
78 3 mask = 1 << which_bit;
79 3 buff_instr(&ts->txb, (P1 & mask) ? "1" : "0");
80 3 }
81 2
82 2 PORTB_EN=0xc0; /*Configure PortB as input pin.*/
83 2 input=PORTB;
84 2
85 2 /*Egi web page needs PB switch data.*/
86 2 if (!strncmp(str, "$switch", 7) && isdigit(*(str+7)))
87 2 {
88 3 i = *(str+7) - '0';
89 3 buff_instr (&ts->txb, (input & (0x08 >> i)) ? "0" : "1");
90 3 }
91 2
92 2 }
93 1 }
94
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 426 ----
CONSTANT SIZE = 28 ----
XDATA SIZE = ---- 11
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -