C51 COMPILER V9.02   MAIN                                                                  12/12/2025 17:29:44 PAGE 1   


C51 COMPILER V9.02, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN .\output\main.obj
COMPILER INVOKED BY: D:\Keil\C51\BIN\C51.EXE source\main.c OMF2 BROWSE DEBUG PRINT(.\lst\main.lst) OBJECT(.\output\main.
                    -obj)

line level    source

   1          #ifndef _MAIN_C_
   2          #define _MAIN_C_
   3          /*********************************************************************************************************
             -************/
   4          #include "include/ca51f_config.h"               
   5          #include "include/ca51f2sfr.h"
   6          #include "include/ca51f2xsfr.h"
   7          #include "include/gpiodef_f2.h"
   8          #include "include/system_clock.h"
   9          
  10          #include "include/uart.h"
  11          #include "include/delay.h"
  12          #include <intrins.h>
  13          /*********************************************************************************************************
             -************/
  14          
  15          void main(void)
  16          {
  17   1              unsigned char data_temp;
  18   1      #if (SYSCLK_SRC == PLL)
                      Sys_Clk_Set_PLL(PLL_Multiple);  //设置系统时钟为PLL，PLL_Multiple为倍频倍数
              #endif
  21   1              
  22   1              Uart1_Initial(115200);  //初始化UART1
  23   1      
  24   1              EA = 1;                                                                                                 //开全局中断
  25   1      
  26   1              uart_printf("Uart1 Demo Code\n");
  27   1      
  28   1              while(1)
  29   1              {
  30   2                      /*
  31   2                              数组uart1_rx_buf为UART1接收buffer, uart1_rev.head和uart1_rev.tail为buffer的头尾指针，当头尾指针不相等时
             -，表示
  32   2                              buffer有接收到数据。本例程实现把UART1 RX接收到的数据通过UART1 TX发送出去。
  33   2                      */
  34   2                      if(uart1_rev.tail != uart1_rev.head)                            //表示有数据待取
  35   2                      {
  36   3                              uart1_rev.tail++;
  37   3                              uart1_rev.tail %= UART1_RX_BUF_SIZE;                            
  38   3                              data_temp=uart1_rx_buf[uart1_rev.tail];                 //从uart1_rx_buf取出数据
  39   3                              
  40   3                              Uart1_PutChar(data_temp);                                               //把接收到的数据发送出去
  41   3                      }               
  42   2              }
  43   1      }
  44          #endif
  45          
  46          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =     62    ----
   CONSTANT SIZE    =     17    ----
C51 COMPILER V9.02   MAIN                                                                  12/12/2025 17:29:44 PAGE 2   

   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----       1
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
   EDATA SIZE       =   ----    ----
   HDATA SIZE       =   ----    ----
   XDATA CONST SIZE =   ----    ----
   FAR CONST SIZE   =   ----    ----
END OF MODULE INFORMATION.


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