PaulStoffregen
Well-known member
Ok, I'm looking at the UHS 2.0 code. I see this at line 313:
Then I see this at line 222:
I guess I don't really understand why they bother to with epDataInIndexVSP and epDataOutIndexVSP, and 2 more sets of info in their list of endpoints, when they'll just unconditionally use the "VSP" entries when isMidiFound is false. What's the point?
But what I *really* don't understand is how this code deals with the *many* USB devices that have interfaces with 2 bulk endpoints. What happens if you try to use a hub, a MIDI drumpad, and also a FTDI serial board? What keeps the USBH_MIDI from trying to talk MIDI to the FTDI device? Likewise for USB storage and many other interfaces that use 2 bulk endpoints?
Code:
if( isMidi )
index = ((epDesc->bEndpointAddress & 0x80) == 0x80) ? epDataInIndex : epDataOutIndex;
else
index = ((epDesc->bEndpointAddress & 0x80) == 0x80) ? epDataInIndexVSP : epDataOutIndexVSP;
Then I see this at line 222:
Code:
if( !isMidiFound ){ //MIDI Device not found. Try last Bulk transfer device
USBTRACE("MIDI not found. Attempts bulk device\r\n");
epInfo[epDataInIndex].epAddr = epInfo[epDataInIndexVSP].epAddr;
epInfo[epDataInIndex].maxPktSize = epInfo[epDataInIndexVSP].maxPktSize;
epInfo[epDataOutIndex].epAddr = epInfo[epDataOutIndexVSP].epAddr;
epInfo[epDataOutIndex].maxPktSize = epInfo[epDataOutIndexVSP].maxPktSize;
}
I guess I don't really understand why they bother to with epDataInIndexVSP and epDataOutIndexVSP, and 2 more sets of info in their list of endpoints, when they'll just unconditionally use the "VSP" entries when isMidiFound is false. What's the point?
But what I *really* don't understand is how this code deals with the *many* USB devices that have interfaces with 2 bulk endpoints. What happens if you try to use a hub, a MIDI drumpad, and also a FTDI serial board? What keeps the USBH_MIDI from trying to talk MIDI to the FTDI device? Likewise for USB storage and many other interfaces that use 2 bulk endpoints?