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

📄 protozlg.lst

📁 用keil c和vb开发的单片机通用usb键盘
💻 LST
字号:
C51 COMPILER V7.06   PROTOZLG                                                              11/03/2006 10:24:17 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE PROTOZLG
OBJECT MODULE PLACED IN Protozlg.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE Protozlg.c OPTIMIZE(2,SPEED) DEBUG OBJECTEXTEND

stmt level    source

   1          #include <stdio.h>
   2          #include <string.h>
   3          
   4          #include <reg51.h>                /* special function register declarations   */
   5          #include "isr.h"
   6          #include "mainloop.h"
   7          #include "protozlg.h"
   8          
   9          extern CONTROL_XFER ControlData;
  10          extern IO_REQUEST idata ioRequest;
  11          extern EPPFLAGS bEPPflags;
  12          extern unsigned char idata EpBuf[];
  13          byte_count byte_cnt;
  14          
  15          
  16          void get_firmware_version()
  17          {
  18   1              unsigned char i;
  19   1      
  20   1              i = 0x30; // firmware version number
  21   1              single_transmit((unsigned char *)&i, 1);
  22   1      }
  23          
  24          void get_buffer_size()
  25          {
  26   1              unsigned char i[4];
  27   1      
  28   1              i[0] = EP2_PACKET_SIZE;
  29   1              i[1] = 0;
  30   1              i[2] = 0;
  31   1              i[3] = 0;
  32   1              single_transmit((unsigned char *)&i, 4);
  33   1      }
  34          
  35          void read_write_register(void)
  36          {
  37   1      //      unsigned char i;
  38   1      
  39   1              if(ControlData.DeviceRequest.bmRequestType & (unsigned char)USB_ENDPOINT_DIRECTION_MASK) {
  40   2                      if(ControlData.DeviceRequest.wIndex == GET_FIRMWARE_VERSION &&
  41   2                              ControlData.DeviceRequest.wValue == 0 &&
  42   2                              ControlData.DeviceRequest.wLength == 1)
  43   2                              get_firmware_version();
  44   2                      else
  45   2                      if(ControlData.DeviceRequest.wIndex == GET_BUFFER_SIZE &&
  46   2                              ControlData.DeviceRequest.wValue == 0 &&
  47   2                              ControlData.DeviceRequest.wLength == 4)
  48   2                              get_buffer_size();
  49   2                      else
  50   2                              stall_ep0();
  51   2      
  52   2              }       // if read register
  53   1              else{
  54   2                      if(ControlData.DeviceRequest.wIndex == SETUP_DMA_REQUEST &&
  55   2                              ControlData.DeviceRequest.wValue == 0 &&
C51 COMPILER V7.06   PROTOZLG                                                              11/03/2006 10:24:17 PAGE 2   

  56   2                              ControlData.DeviceRequest.wLength == 6)
  57   2                              {
  58   3                                      if(ControlData.dataBuffer[5]==0x81)
  59   3                                      {
  60   4                                              byte_cnt.byte.high = ControlData.dataBuffer[4];
  61   4                                              byte_cnt.byte.low = ControlData.dataBuffer[3];
  62   4                                              if(byte_cnt.word<64)
  63   4                                              {
  64   5                                                      D12_WriteEndpoint(5, byte_cnt.byte.low, EpBuf);
  65   5                                                      byte_cnt.word=0;
  66   5                                              }
  67   4                                              else
  68   4                                              {
  69   5                                                      byte_cnt.word=byte_cnt.word-64;
  70   5                                                      D12_WriteEndpoint(5, 64, EpBuf);
  71   5                                              }
  72   4                                      }
  73   3                                      if(ControlData.dataBuffer[5]==0x82)
  74   3                                      {
  75   4      //                                      i = D12_ReadEndpoint(4, 64, EpBuf);//读空端点2数据
  76   4      //                                      i = D12_ReadEndpoint(4, 64, EpBuf);
  77   4                                      }
  78   3                                      single_transmit(0, 0);
  79   3                              }
  80   2                      else
  81   2                              stall_ep0();
  82   2              }       // if write register
  83   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    215    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =      2       5
   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 + -