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

📄 main.lst

📁 用SL811USB接口芯片读写U盘FAT16固化程序(C51源代码)
💻 LST
字号:
C51 COMPILER V7.06   MAIN                                                                  09/18/2004 01:20:10 PAGE 1   


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

stmt level    source

   1          #include "common.H"
   2          #include "SL811.H"
   3          #include "TPBULK.H"
   4          #include "HAL.H"
   5          #include "HPI.H"
   6          
   7          FLAGS bdata bFlags;
   8          extern unsigned char xdata DBUF[BUFFER_LENGTH];
   9          /////////////////////////////////////////////////
  10          
  11          extern unsigned char xdata UARTBUF[UARTBUF_LENGTH];
  12          extern Command_Def xdata Command;       
  13          extern unsigned int xdata DirStartCluster;              
  14          //////////////////////////////////////////
  15          
  16          void Init_SpecialInterrupts(void)
  17          {
  18   1              IT0 = 0;
  19   1              EX0 = 1;
  20   1      }
  21          
  22          void Init_Port()
  23          {
  24   1              P0 = 0xFF;
  25   1              P1 = 0xFF;
  26   1              P2 = 0xFF;
  27   1              P3 = 0xFF;
  28   1              SL811_CS=0;
  29   1      }
  30          
  31          /*Serial Port */
  32          /*Mode            = 1  /8-bit UART
  33            Serial Port Interrupt    = Disabled         */
  34          /*Receive         = Enabled   */
  35          /*Auto Addressing    = Disabled   */
  36          void Init_COMM(void)
  37          {
  38   1              SCON = 0x53;
  39   1              PCON = 0x80 | PCON;
  40   1              T2CON=0x30;
  41   1              RCAP2H=0xFF;            // 57600 @ 24MHz: 24000000/(32*(65536-(RCAP2H,RCAP2L)))
  42   1              RCAP2L=0xF3;
  43   1              TI=0;
  44   1              RI=0;
  45   1              TR2=1;
  46   1              ES = 1;
  47   1      }
  48          
  49          void    main(void)
  50          {
  51   1              unsigned char temp;
  52   1              unsigned long xdata time_count;
  53   1      
  54   1              SL811_RST=0;
  55   1              DelayMs(250);
C51 COMPILER V7.06   MAIN                                                                  09/18/2004 01:20:10 PAGE 2   

  56   1              SL811_RST=1;
  57   1      
  58   1              Init_SpecialInterrupts();
  59   1              Init_Port();
  60   1          Init_COMM();
  61   1              SL811_Init();
  62   1      
  63   1              bFlags.bits.bUartInDone=0;      
  64   1              DirStartCluster=0;
  65   1      
  66   1              for(temp=0;temp<64;temp++)
  67   1                      DBUF[temp]=0;
  68   1      
  69   1              ENABLE_INTERRUPTS;
  70   1              
  71   1              while(TRUE)
  72   1              {
  73   2              time_count++;           
  74   2                      if (time_count>1000)
  75   2                              {
  76   3                              DISABLE_INTERRUPTS;
  77   3                              time_count = 0;
  78   3                              ENABLE_INTERRUPTS;      
  79   3                              check_key_LED();                        
  80   3                              }
  81   2                      if(bFlags.bits.SLAVE_FOUND){
  82   3                              DISABLE_INTERRUPTS;
  83   3                              bFlags.bits.SLAVE_FOUND=FALSE;
  84   3                          DelayMs(250);
  85   3                              if(EnumUsbDev(1))                               // enumerate USB device, assign USB address = #1
  86   3                              {
  87   4                                      bFlags.bits.SLAVE_ENUMERATED = TRUE;    // Set slave USB device enumerated flag 
  88   4                                      DirStartCluster=0;                      
  89   4                                      MCU_LED1=0;
  90   4                              }       
  91   3                              ENABLE_INTERRUPTS;      
  92   3                              }
  93   2                      if(bFlags.bits.SLAVE_REMOVED){
  94   3                              DISABLE_INTERRUPTS;
  95   3                              bFlags.bits.SLAVE_REMOVED=FALSE;
  96   3                              bFlags.bits.SLAVE_ENUMERATED = FALSE;
  97   3                              bFlags.bits.SLAVE_IS_ATTACHED = FALSE;
  98   3                              MCU_LED1=1;MCU_LED2=1;
  99   3                              ENABLE_INTERRUPTS;      
 100   3                              }
 101   2                      if(bFlags.bits.bUartInDone){
 102   3                              DISABLE_INTERRUPTS;
 103   3                              bFlags.bits.bUartInDone=0;      
 104   3                              UartHandler();
 105   3                              ENABLE_INTERRUPTS;      
 106   3                              }
 107   2                      if(bFlags.bits.bMassDevice){
 108   3                              DISABLE_INTERRUPTS;
 109   3                              bFlags.bits.bMassDevice=FALSE;
 110   3                              if(EnumMassDev())
 111   3                                      {
 112   4                                      bFlags.bits.SLAVE_IS_ATTACHED = TRUE;
 113   4                                      MCU_LED2=0;                                                     
 114   4                                      }
 115   3                              else
 116   3                                      {                               
 117   4                                      bFlags.bits.SLAVE_IS_ATTACHED = FALSE;                          
C51 COMPILER V7.06   MAIN                                                                  09/18/2004 01:20:10 PAGE 3   

 118   4                                      temp=SL811Read(IntStatus);
 119   4                                      if(!(temp & 0x40))      bFlags.bits.SLAVE_FOUND=TRUE;
 120   4                                      }               
 121   3                                      ENABLE_INTERRUPTS;      
 122   3                              }       
 123   2                      
 124   2              }
 125   1              
 126   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    290    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----       4
   PDATA SIZE       =   ----    ----
   DATA SIZE        =     10       1
   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 + -