C51 COMPILER V7.06 ISO 08/18/2005 15:30:28 PAGE 1 C51 COMPILER V7.06, COMPILATION OF MODULE ISO OBJECT MODULE PLACED IN ISO.OBJ COMPILER INVOKED BY: d:\Keil777\C51\BIN\C51.EXE ISO.C BROWSE DEBUG OBJECTEXTEND stmt level source 1 2 #include 3 #include 4 #include *** WARNING C318 IN LINE 4 OF ISO.C: can't open file 'unistd.h' 5 #include "BasicTyp.h" 6 #include "common.h" 7 #include "usb.h" 8 #include "Hal4D13.h" 9 #include "chap_9.h" 10 #include "D13BUS.h" 11 #include "iso.h" 12 #include "system.h" 13 #include "usb_irq.h" 14 15 extern D13FLAGS bD13flags; 16 extern CONTROL_XFER ControlData; 17 extern IO_REQUEST idata ioRequest; 18 19 unsigned char IsoDisable =1; 20 unsigned char IsoMode = 0; //ISO_IN:01|ISO_OUT:02; 21 unsigned short IsoOutPattern=0xF0; 22 unsigned short IsoOutPktLen=0; 23 unsigned short IsoOutDataBuff[ISO_FIFOSIZE_512]; 24 unsigned short IsoInPattern=0xF8; 25 unsigned short IsoInPktLen=0; 26 unsigned short IsoInDataBuff[ISO_FIFOSIZE_512]; 27 28 void EnableIsoMode() 29 { 30 1 IsoMode = 0; 31 1 if( ControlData.DeviceRequest.wLength == 0) 32 1 { 33 2 IsoMode &= ~ControlData.DeviceRequest.wIndex; 34 2 IsoMode |= ControlData.DeviceRequest.wValue; 35 2 36 2 printf("IsoMode %x\n",IsoMode ); 37 2 38 2 if(IsoMode&ISO_LOOP) 39 2 { 40 3 41 3 RaiseIRQL(); 42 3 bD13flags.bits.ISO_state = ISO_LOOP; 43 3 LowerIRQL(); 44 3 45 3 IsoDisable =0; 46 3 IsoInPattern = 0; 47 3 IsoInPktLen = ISO_FIFOSIZE_512; 48 3 IsoOutPattern = 0; 49 3 IsoOutPktLen = ISO_FIFOSIZE_512; 50 3 51 3 } 52 2 else 53 2 { 54 3 C51 COMPILER V7.06 ISO 08/18/2005 15:30:28 PAGE 2 55 3 if(IsoMode&ISO_OUT) 56 3 { 57 4 58 4 RaiseIRQL(); 59 4 bD13flags.bits.ISO_state = ISO_OUT; 60 4 LowerIRQL(); 61 4 62 4 IsoDisable =0; 63 4 IsoOutPattern = 0; 64 4 IsoOutPktLen = ISO_FIFOSIZE_512; 65 4 printf("Iso-Out Pattern %x, PktLen %u bytes\n",IsoInPattern,IsoOutPktLen); 66 4 67 4 } 68 3 if(IsoMode&ISO_IN) 69 3 { 70 4 bD13flags.bits.ISO_state = ISO_IN; 71 4 72 4 IsoDisable =0; 73 4 IsoInPattern = 0; 74 4 IsoInPktLen = ISO_FIFOSIZE_512; 75 4 76 4 IOWR(ISP1362_BASE,D13_COMMAND_PORT, D13CMD_EP_VALID_BUF+EPINDEX4EP06); *** WARNING C206 IN LINE 76 OF ISO.C: 'IOWR': missing function-prototype *** ERROR C267 IN LINE 76 OF ISO.C: 'IOWR': requires ANSI-style prototype 77 4 printf("Iso-IN Pattern %x, PktLen %u bytes\n",IsoInPattern,IsoInPktLen); 78 4 } 79 3 80 3 } 81 2 82 2 Chap9_SingleTransmitEP0(0, 0); 83 2 } 84 1 else 85 1 { 86 2 Chap9_StallEP0(); 87 2 } 88 1 } 89 90 91 void Wait4Ns( unsigned long timeNs) 92 { 93 1 usleep(timeNs); 94 1 } 95 96 USHORT ISOLOOP(UCHAR bOUTEPIndex, UCHAR bINEPIndex, USHORT len) 97 { 98 1 USHORT ISOBuffer[512]; 99 1 UCHAR ep_last; 100 1 USHORT j=0; 101 1 102 1 ep_last = (UCHAR)Hal4D13_GetEndpointStatusWInteruptClear(bOUTEPIndex); 103 1 if(ep_last & 0x60) 104 1 { 105 2 j = Hal4D13_ReadISOEndpoint(bOUTEPIndex, ISOBuffer, len); 106 2 Hal4D13_WriteISOEndpoint(bINEPIndex, ISOBuffer, j); 107 2 } 108 1 109 1 return j; 110 1 } 111 112 USHORT Hal4D13_ReadISOEndpoint(UCHAR bEPIndex, USHORT ISOBuffer[512], USHORT len) 113 { 114 1 USHORT i, j; C51 COMPILER V7.06 ISO 08/18/2005 15:30:28 PAGE 3 115 1 116 1 IOWR(ISP1362_BASE,D13_COMMAND_PORT, D13CMD_EP_RD_FIFO + bEPIndex); 117 1 118 1 j = IORD(ISP1362_BASE,D13_DATA_PORT); 119 1 120 1 if(j != len) 121 1 j = len; 122 1 123 1 for(i=0; i