#define USB_DATA_BUFFER_TEM_LENGTH 512 |
#define USB_DATA_BUFFER_TEM_LENGTH 600 |
if ((usb_data_buffer_OUT_size[0] + tem + dmaDescriptor[PhyEP].MaxPacketSize) > 512) { USB_REG(0)->DMAIntEn &= ~(1 << 1); } |
if ((usb_data_buffer_OUT_size[0] + tem + dmaDescriptor[PhyEP].MaxPacketSize) > 550) { USB_REG(0)->DMAIntEn &= ~(1 << 1); } |
....... else { int i; for(i=0;i<TotalBlocks;i++) { while(!Endpoint_IsReadWriteAllowed(0)); Endpoint_Read_Stream_LE(0,buffer,VIRTUAL_MEMORY_BLOCK_SIZE, NULL) Endpoint_ClearOUT(0); MassStorage_Write((BlockAddress+i),buffer, VIRTUAL_MEMORY_BLOCK_SIZE); } }...... |
....... else { int i; for(i=0;i<TotalBlocks;i++) { while(!Endpoint_IsReadWriteAllowed(0)); bytes = Endpoint_BytesInEndpoint(0); if(bytes > VIRTUAL_MEMORY_BLOCK_SIZE) { Endpoint_Read_Stream_LE(0,buffer,bytes - VIRTUAL_MEMORY_BLOCK_SIZE, NULL); bytes = VIRTUAL_MEMORY_BLOCK_SIZE; } Endpoint_Read_Stream_LE(0,buffer,bytes,NULL); Endpoint_ClearOUT(0); MassStorage_Write((BlockAddress+i),buffer, VIRTUAL_MEMORY_BLOCK_SIZE); } }....... |
static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const bool IsDataRead) { ..... /* Determine if the packet is a READ (10) or WRITE (10) command, call appropriate function */ #if 0 [color=#c33]here you have to chage this for #if 1[/color] ...... } |