a fiendly hello to the keil arm7 forum members !!!
i need to move the msc data and control processing fron the isr runtime into the main background loop.
i took the following steps :
1) file mscuser.c function MSC_GetCBW.c
deferred processing of the following commands
case SCSI_TEST_UNIT_READY: case SCSI_REQUEST_SENSE: case SCSI_INQUIRY: case SCSI_MODE_SENSE6: case SCSI_MODE_SENSE10: case SCSI_READ_FORMAT_CAPACITIES: case SCSI_READ_CAPACITY:
case SCSI_READ10:
by using a command variable which holds the current command and parse them in a 2nd switch statement the main loop and calling the following functions now from the main loop
MSC_TestUnitReady(); MSC_RequestSense(); MSC_Inquiry(); MSC_ModeSense6(); MSC_ModeSense10(); MSC_ReadFormatCapacity(); MSC_ReadCapacity();
MSC_MemoryRead();
this works fine since all of these commands are usb "in" commands and not "out" commands
the MSC_MemoryRead() is also deferred processed in a similar way in the function MSC_BulkIn
case MSC_BS_DATA_IN:
this all works fine so far, but here comes the real problem
2) i apply a similar defer technique in the main loop to the
MSC_MemoryWrite(); case in function MSC_BulkOut
i also move the line
BulkLen = USB_ReadEP(MSC_EP_OUT, BulkBuf);
from the isr into the main loop to avoid ack'ing the receipt of the usb out package until i process it in the main loop. (the ack / nack of the out package in slave mode in the last step is an assumption of mine)
3) the implementation of step 2 does not succeed.
what am i doing wrong ???
how can i move the processing of usb out packages from the isr domain into the main loop domain ???
any help and suggestions are highly appreciated
thanks, Klaus