?? protozlg.lst
字號:
C51 COMPILER V6.23a PROTOZLG 05/30/2004 15:59:30 PAGE 1
C51 COMPILER V6.23a, 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 /*
2 //*************************************************************************
3 //
4 // ZLGMCU
5 // www.zlgmcu.com
6 // File Name: ISR.C
7 // Revision: V0.2(2002-04-08)
8 // Use library: USB51S.LIB
9 // Note: USB51S.LIB不帶DMA控制功能
10 //*************************************************************************
11 */
12
13 #include <stdio.h>
14 #include <string.h>
15
16 #include <reg51.h> /* special function register declarations */
17 #include "isr.h"
18 #include "mainloop.h"
19 #include "protozlg.h"
20
21 extern CONTROL_XFER ControlData;
22 extern IO_REQUEST idata ioRequest;
23 extern EPPFLAGS bEPPflags;
24 extern unsigned char idata EpBuf[];
25
26
27 void get_firmware_version()
28 {
29 1 unsigned char i;
30 1
31 1 i = 0x30; // firmware version number
32 1 single_transmit((unsigned char *)&i, 1);
33 1 }
34
35 void get_buffer_size()
36 {
37 1 unsigned char i[4];
38 1
39 1 i[0] = EP2_PACKET_SIZE;
40 1 i[1] = 0;
41 1 i[2] = 0;
42 1 i[3] = 0;
43 1 single_transmit((unsigned char *)&i, 4);
44 1 }
45
46 void read_write_register(void)
47 {
48 1 // unsigned char i;
49 1
50 1 if(ControlData.DeviceRequest.bmRequestType & (unsigned char)USB_ENDPOINT_DIRECTION_MASK) {
51 2 if(ControlData.DeviceRequest.wIndex == GET_FIRMWARE_VERSION &&
52 2 ControlData.DeviceRequest.wValue == 0 &&
53 2 ControlData.DeviceRequest.wLength == 1)
54 2 get_firmware_version();
55 2 else
C51 COMPILER V6.23a PROTOZLG 05/30/2004 15:59:30 PAGE 2
56 2 if(ControlData.DeviceRequest.wIndex == GET_BUFFER_SIZE &&
57 2 ControlData.DeviceRequest.wValue == 0 &&
58 2 ControlData.DeviceRequest.wLength == 4)
59 2 get_buffer_size();
60 2 else
61 2 stall_ep0();
62 2
63 2 } // if read register
64 1 else{
65 2 if(ControlData.DeviceRequest.wIndex == SETUP_DMA_REQUEST &&
66 2 ControlData.DeviceRequest.wValue == 0 &&
67 2 ControlData.DeviceRequest.wLength == 6)
68 2 {
69 3 if(ControlData.dataBuffer[5]==0x81)
70 3 D12_WriteEndpoint(5, ControlData.dataBuffer[3], EpBuf);
71 3 single_transmit(0, 0);
72 3 }
73 2 else
74 2 stall_ep0();
75 2 } // if write register
76 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 164 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 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 + -