main.lst

来自「STC51系列的源码」· LST 代码 · 共 152 行

LST
152 行
字号
C51 COMPILER V8.02   MAIN                                                                  10/20/2008 13:54:41 PAGE 1   


C51 COMPILER V8.02, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN MAIN.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE MAIN.c LARGE BROWSE DEBUG OBJECTEXTEND

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 "../KEY/KEY.h"
  13          #include "../TC1602A/TC1602A.h"
  14          
  15          unsigned int  system_timer=0x00;    //* 这是系统需要的定时器变量
  16          
  17          /********************************************************************************/
  18          /* fun_name : MAIN_key_timer()                                                  */
  19          /* version  : v1.00                                                             */
  20          /* created  : xillinx                                                           */
  21          /********************************************************************************/
  22          void MAIN_key_timer(void) 
  23          {   KEY_scan_timer=0x1;
  24   1      } 
  25          
  26          /********************************************************************************/
  27          /* fun_name : MAIN_c51_key_scan()                                               */
  28          /* version  : v1.00                                                             */
  29          /* created  : xillinx                                                           */
  30          /* descript : 这个函数需要在定时器里面调用                                      */
  31          /********************************************************************************/
  32          void MAIN_c51_key_scan(void)
  33          {   unsigned char key_val; 
  34   1          char buffer[0x20];
  35   1          if(KEY_scan_timer==0x0) //* 定时器没有到
  36   1          {  return;
  37   2          }
  38   1          KEY_scan_timer=0x0;
  39   1          key_val=c51_key_scan_process_jitter(); //* 8x3=24MS定时器,扫描键盘
*** WARNING C206 IN LINE 39 OF MAIN.C: 'c51_key_scan_process_jitter': missing function-prototype
  40   1          if(key_val!=0x0)
  41   1          {  sprintf(buffer,"  KEY: %c          ",key_val);
  42   2             LCDT_print_string(0x0,0x0,buffer);
  43   2          }
  44   1          key_val=c51_key_scan_hi_process();
*** WARNING C206 IN LINE 44 OF MAIN.C: 'c51_key_scan_hi_process': missing function-prototype
  45   1          switch(key_val)
  46   1          {
  47   2          case 0x1:
  48   2               sprintf(buffer,"  KEY: %s          ","F1");
  49   2               LCDT_print_string(0x0,0x1,buffer);
  50   2               break;
  51   2          case 0x2:
  52   2               sprintf(buffer,"  KEY: %s          ","F2");
  53   2               LCDT_print_string(0x0,0x1,buffer);
C51 COMPILER V8.02   MAIN                                                                  10/20/2008 13:54:41 PAGE 2   

  54   2               break;
  55   2          case 0x3:
  56   2               sprintf(buffer,"  KEY: %s          ","F3");
  57   2               LCDT_print_string(0x0,0x1,buffer);
  58   2               break;
  59   2          case 0x4:
  60   2               sprintf(buffer,"  KEY: %s          ","F4");
  61   2               LCDT_print_string(0x0,0x1,buffer);
  62   2               break;
  63   2          default:
  64   2               break;
  65   2          }
  66   1          
  67   1          return;
  68   1      }
  69          
  70          /********************************************************************************/
  71          /* fun_name : MAIN_interrupt_hook_process()                                     */
  72          /* version  : v1.00                                                             */
  73          /* created  : xillinx                                                           */
  74          /* descript : 定时器钩子函数的处理,如果需要使用这些函数,需要重新挂接,如果不需要 */
  75          /*  不需要做任何事情                                                            */
  76          /********************************************************************************/
  77          void MAIN_interrupt_hook_process (void)
  78          {   CPU_001_tick_process = CPU_interrupt_proc_null; //* 定时器钩子函数的缺省处理,如果需要使用这些函数,需要
             -重新挂接
  79   1          CPU_002_tick_process = CPU_interrupt_proc_null;
  80   1          CPU_004_tick_process = CPU_interrupt_proc_null;
  81   1          CPU_008_tick_process = CPU_interrupt_proc_null;
  82   1          CPU_010_tick_process = CPU_interrupt_proc_null;
  83   1          CPU_020_tick_process = CPU_interrupt_proc_null;
  84   1          CPU_040_tick_process = CPU_interrupt_proc_null;
  85   1          CPU_080_tick_process = CPU_interrupt_proc_null;
  86   1          CPU_100_tick_process = CPU_interrupt_proc_null;
  87   1          CPU_200_tick_process = CPU_interrupt_proc_null;
  88   1          CPU_400_tick_process = CPU_interrupt_proc_null;
  89   1          CPU_extern_0_process = CPU_interrupt_proc_null;
  90   1          CPU_extern_1_process = CPU_interrupt_proc_null;
  91   1          CPU_timer_02_process = CPU_interrupt_proc_null;
  92   1                                                          //* 重新挂接HOOK函数
  93   1          CPU_001_tick_process = HC595_refresh;           //* 2MS
  94   1          CPU_008_tick_process = MAIN_key_timer;          //* 按键扫描
  95   1          CPU_080_tick_process = LED_refresh;             //* 128x2=256MS
  96   1      }
  97          
  98          /********************************************************************************/
  99          /* function : main()                                                            */
 100          /* recension: xillinx                                                           */
 101          /* descript : 主函数入口                                                        */
 102          /********************************************************************************/
 103          void main (void)
 104          {   unsigned int delax=0x8000;
 105   1          while(delax--)
 106   1          {   ;
 107   2          }
 108   1          LCDT_initialize();
 109   1          UART_buffer_initilize();
 110   1          MAIN_interrupt_hook_process();      //* CPU的挂接函数处理
 111   1          CPU_source_initialize();            //* 控制CPU的资源
 112   1          SEG7_clear_screen();
 113   1          SEG7_printf_ascii("1234.567");      //* 测试七段数码管
 114   1          UART_printf("融益通讯学习板\r\n");  //* 测试UART串口
C51 COMPILER V8.02   MAIN                                                                  10/20/2008 13:54:41 PAGE 3   

 115   1          LCDT_print_string(0x0,0x0,"rongyitong tech");     /* 测试点阵LCD */
 116   1          LCDT_print_string(0x0,0x1,"cchhww11@tom.com");
 117   1          while(1) 
 118   1          {   MAIN_c51_key_scan();
 119   2          }
 120   1      }
 121          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    533    ----
   CONSTANT SIZE    =    111    ----
   XDATA SIZE       =      2      33
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  2 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?