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

📄 main.lst

📁 STC51系列的源码
💻 LST
字号:
C51 COMPILER V8.02   MAIN                                                                  10/28/2008 15:31:43 PAGE 1   


C51 COMPILER V8.02, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN .\out\main.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE main.c LARGE OPTIMIZE(SIZE) BROWSE DEBUG OBJECTEXTEND PRINT(.\out\main.lst)
                    - OBJECT(.\out\main.obj)

line level    source

   1          /********************************************************************************/
   2          /* filename : MAIN.c                                                            */
   3          /* created  : xillinx                                                           */
   4          /* descript : 系统的C函数入口                                                   */
   5          /********************************************************************************/
   6          #include "../CPU/CPU.h"
   7          #include "../CFG/CFG.h"
   8          #include "../UART/UART.h"
   9          #include "../LED/LED.h"
  10          #include "../SEG7/SEG7.h"
  11          #include "../HC595/HC595.h"
  12          #include "main.h"
  13          
  14          unsigned int system_timer;
  15          
  16          u8_t   arptimer;
  17          u8_t   tcptimer;
  18          
  19          /********************************************************************************/
  20          /* fun_name : MAIN_uip_timer()                                                  */
  21          /* version  : v1.00                                                             */
  22          /* created  : xillinx                                                           */
  23          /********************************************************************************/
  24          void MAIN_uip_timer(void) 
  25          {   arptimer++;
  26   1          tcptimer++;
  27   1      } 
  28          
  29          
  30          
  31          /********************************************************************************/
  32          /* fun_name : MAIN_interrupt_hook_process()                                     */
  33          /* version  : v1.00                                                             */
  34          /* created  : xillinx                                                           */
  35          /* descript : 定时器钩子函数的处理,如果需要使用这些函数,需要重新挂接,如果不需要 */
  36          /*  不需要做任何事情                                                            */
  37          /********************************************************************************/
  38          void MAIN_interrupt_hook_process (void)
  39          {   CPU_001_tick_process = CPU_interrupt_proc_null; //* 定时器钩子函数的缺省处理,如果需要使用这些函数,需要
             -重新挂接
  40   1          CPU_002_tick_process = CPU_interrupt_proc_null;
  41   1          CPU_004_tick_process = CPU_interrupt_proc_null;
  42   1          CPU_008_tick_process = CPU_interrupt_proc_null;
  43   1          CPU_010_tick_process = CPU_interrupt_proc_null;
  44   1          CPU_020_tick_process = CPU_interrupt_proc_null;
  45   1          CPU_040_tick_process = CPU_interrupt_proc_null;
  46   1          CPU_080_tick_process = CPU_interrupt_proc_null;
  47   1          CPU_100_tick_process = CPU_interrupt_proc_null;
  48   1          CPU_200_tick_process = CPU_interrupt_proc_null;
  49   1          CPU_400_tick_process = CPU_interrupt_proc_null;
  50   1          CPU_extern_0_process = CPU_interrupt_proc_null;
  51   1          CPU_extern_1_process = CPU_interrupt_proc_null;
  52   1          CPU_timer_02_process = CPU_interrupt_proc_null;
  53   1                                                          //* 重新挂接HOOK函数
C51 COMPILER V8.02   MAIN                                                                  10/28/2008 15:31:43 PAGE 2   

  54   1          CPU_001_tick_process = HC595_refresh;           //* 2MS
  55   1          CPU_080_tick_process = LED_refresh;             //* 128x2=256MS
  56   1          CPU_040_tick_process = MAIN_uip_timer;          //* 64*2=128MS
  57   1      }
  58          
  59          void main(void)
  60          { 
  61   1          u8_t   i, arptimer;
  62   1          
  63   1          MAIN_interrupt_hook_process();
  64   1          UART_buffer_initilize();
  65   1          CPU_timer_0_initialize();
  66   1          CPU_timer_2_initialize();
  67   1          CPU_uart_serial_initial();
  68   1          CPU_source_initialize();    //* 控制CPU的资源
  69   1          SEG7_clear_screen();
  70   1          SEG7_clear_screen();
  71   1          
  72   1          rtl8019_reset();
  73   1          rtl8019_initialize();
  74   1          
  75   1          SEG7_printf_ascii("1234.567");      //* 测试七段数码管
  76   1          UART_printf("融益通讯学习板\r\n");  //* 测试UART串口
  77   1      
  78   1          /* Initialise the uIP TCP/IP stack. */
  79   1          uip_init();
  80   1      
  81   1          /* Initialise the app. */
  82   1          httpd_init();
  83   1      
  84   1      
  85   1          /* Initialise the ARP cache. */
  86   1          uip_arp_init();
  87   1      
  88   1          arptimer = 0;
  89   1      
  90   1          while(1)
  91   1          {
  92   2              uip_len = etherdev_read();
  93   2      
  94   2              if(uip_len == 0)
  95   2              {   if(tcptimer<8)
  96   3                  {   continue;
  97   4                  }
  98   3                  tcptimer=0x0;
  99   3                  for(i = 0; i < UIP_CONNS; i++)
 100   3                  {
 101   4                      uip_periodic(i);
 102   4                      /* If the above function invocation resulted in data that
 103   4                         should be sent out on the network, the global variable
 104   4                         uip_len is set to a value > 0. */
 105   4                      if(uip_len > 0)
 106   4                      {
 107   5                          uip_arp_out();
 108   5                          etherdev_send();
 109   5                      }
 110   4                  }
 111   3      
 112   3      #if UIP_UDP
                          for(i = 0; i < UIP_UDP_CONNS; i++)
                          {
                              uip_udp_periodic(i);
C51 COMPILER V8.02   MAIN                                                                  10/28/2008 15:31:43 PAGE 3   

                              /* If the above function invocation resulted in data that
                                 should be sent out on the network, the global variable
                                 uip_len is set to a value > 0. */
                              if(uip_len > 0)
                              {
                                  uip_arp_out();
                                  etherdev_send();
                              }
                          }
              #endif /* UIP_UDP */
 126   3      
 127   3                  /* Call the ARP timer function every 10 seconds, 80 tick=10S * */
 128   3                  if(arptimer >= 80)
 129   3                  {   
 130   4                          uip_arp_timer();
 131   4                          arptimer = 0;
 132   4                  }
 133   3              }
 134   2              else /* (uip_len != 0) Process incoming */
 135   2              {
 136   3                  if(BUF->type == htons(UIP_ETHTYPE_IP))
 137   3                  {
 138   4                          uip_arp_ipin();
 139   4                          uip_input();
 140   4                          /* If the above function invocation resulted in data that
 141   4                             should be sent out on the network, the global variable
 142   4                             uip_len is set to a value > 0. */
 143   4                          if(uip_len > 0)
 144   4                      {
 145   5                              uip_arp_out();
 146   5                              etherdev_send();
 147   5                          }
 148   4                  }
 149   3                  else if(BUF->type == htons(UIP_ETHTYPE_ARP))
 150   3                  {
 151   4                          uip_arp_arpin();
 152   4                          /* If the above function invocation resulted in data that
 153   4                             should be sent out on the network, the global variable
 154   4                             uip_len is set to a value > 0. */        
 155   4                          if(uip_len > 0)
 156   4                      {       
 157   5                              etherdev_send();
 158   5                          }
 159   4                  }
 160   3              }
 161   2          }
 162   1      
 163   1          return;
 164   1      }
 165          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    412    ----
   CONSTANT SIZE    =     26    ----
   XDATA SIZE       =      4       2
   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 + -