⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 egi_swit.lst

📁 世纪民生公司的带网络功能的单片机CS6209开发http服务器的演示源代码。
💻 LST
字号:
C51 COMPILER V7.50   EGI_SWIT                                                              10/12/2006 15:31:45 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE EGI_SWIT
OBJECT MODULE PLACED IN .\Release\Egi_swit.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE egi_funcs\Egi_swit.c LARGE OPTIMIZE(9,SIZE) BROWSE ORDER MODDP2 INCDIR(.\WE
                    -BPAGE\;..\..\inc\) DEBUG OBJECTEXTEND PRINT(.\Release\Egi_swit.lst) OBJECT(.\Release\Egi_swit.obj)

line level    source

   1          /*
   2           * 
   3           * Egi_swit.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_swit.c contains HTTP ioset.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          
  21          #include <stdio.h>
  22          #include <string.h>
  23          #include <ctype.h>
  24          
  25          #include "ether.h"
  26          #include "netutil.h"
  27          #include "ip.h"
  28          #include "tcp.h"
  29          #include "config.h"
  30          #include "http.h"
  31          #include "ioset.h"
  32          sfr P1 = 0x90 ;
  33          xdata char switch_str[]="switch";
  34          extern webdebug;
  35          /************************************************************************
  36          /*      Function Name : ioset_resp                                                                                      *
  37          /*                                                                                                                                              *
  38          /*      Arguments :                                                                                                             *
  39          /*                      TSOCK xdata *ts: Point to TSOCK.                                                        *
  40          /*                      char xdata *str: Point to egi comment tag string(<!--#)         *
  41          /*                                                       or     NULL if this function is first time be  *
  42          /*                                                       called.                                                                        *
  43          /*                                                                                                                                              *
  44          /*      Return :                                                                                                                        *
  45          /*                      None                                                                                                            *
  46          /*  Comment :                                                                                                                   *
  47          /*                      This function is a callback function for ioset.cgi. First,      *
  48          /*                      this function be called on the start of ioset.cgi with          *
  49          /*                      str=NULL. Then when webpage meet egi comment tag(<!--#) ,       *
  50          /*                      this function will be called , the 'str' is point to egi        *
  51          /*                      comment tag.                                                                                            *
  52          /*                                                                                                                                              *
  53          /************************************************************************/
  54          void ioset_resp(TSOCK xdata *ts, char xdata *str)
C51 COMPILER V7.50   EGI_SWIT                                                              10/12/2006 15:31:45 PAGE 2   

  55          {
  56   1          APPDATA *adp;
  57   1          char *s;
  58   1              RAM_WEB_PAGE *ptr_web_page;
  59   1          int which_bit, mask;
  60   1      
  61   1          adp = (APPDATA *)ts->app;
  62   1      
  63   1          if (!str)/*The egi function is called the first time.*/
  64   1          {/*Init app for ioset.cgi. */
  65   2              adp->egi = ioset_resp;
  66   2              ptr_web_page = search_get_web_page ("ioset.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   2                      /*Find "switch" string in egi request string.*/
  71   2                      s = find_connvar(ts, switch_str);
  72   2              if (*s!=0)/*egi request string have substring of "switch"*/
  73   2              {       /*Set P1*/
  74   3                  which_bit = *(s+6) - '0';
  75   3                  mask = 1 << which_bit;
  76   3                  P1 ^= mask;
  77   3              }
  78   2          }
  79   1          else/*Egi comment tag.*/
  80   1          {
  81   2              if (webdebug)
  82   2                 printf("EGI Tag '%s'\n", str);/*Egi comment tag.*/
  83   2              str += EGI_STARTLEN;/*Skip "<!--#" .*/
  84   2      
  85   2                      /*Egi web page needs P1 led data.*/
  86   2              if (!strncmp(str, "$led", 4) && isdigit(*(str+4)))
  87   2              {
  88   3                  which_bit = *(str+4) - '0';
  89   3                  mask = 0x1 << which_bit;
  90   3                  buff_instr(&ts->txb, (P1 & mask) ? "OFF" : "ON");
  91   3              }
  92   2          }
  93   1      }
  94          
  95          /* EOF */


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    396    ----
   CONSTANT SIZE    =     36    ----
   XDATA SIZE       =      7      14
   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 + -