KurtE
Senior Member+
@all - Sometimes hard to know which thread to discuss things like integration of MTP amd MSC... and the like.
I am going to try doing some additional changes to my branch of the code to add some more support for adding MSC drives/partitions also wonder if they should apply to SD drives as well.
Examples of changes I am thinking about:
a) Something simple: (@WMXZ) - In MTP class I think that the Loop() method should instead use the Task method... That is if you look at all of our examples you will notice that in their loops they all do:
Where it is setup the main USBHost object will loop through and call each devices Task method to allow them to do any function like what you do in your Loop function...
b) Lots of stuff with MSC - First pass startup timing: Example maybe have some drives NOT at startup and/or when MSC Drive Insertion not at that time try to get the free/used space of the device, but wait to do that until after MTP is happy.. On at least a few thumb drives and maybe others this may take several seconds...
b1) I may first try a hack. Currently when I have an LittleFS drive do a format operation, I have an IntervalTimer looking for messages from the host, and this code always returns I am busy status... Wonder if I can get away with that now? That is maybe while we are looking at all of our devices at startup, have the background code try to stall the host, until we are ready for it... Currently if our startup is too slow both Windows and especially Linux won't show anything nor recover.
c) Partitions - Especially with USB Drives, but maybe also SDCards? At startup and/or insertion detection. Detect that there are multiple volumes on that device and if so maybe add storage for each one. Have some pieces in place with SDFat and MSC stuff, but not in the integration. Currently SDFat code has FatPartion and EXPartion classes, but no unifier in the FsLib (i.e no FsPartition.h/cpp files) that work with either in the same way as FsVolume works with FatVolume and ExFatVolume...
d) Again more MSC specific although again could apply to SDCards, like cards you use for RPI have multiple partitions, although so far we don't handle any of the linux file formats...
d1) Wondering about MSC object(s), How should the functionality be factored. More later in MSC thread... Or again wondering if makes sense to talk about all of this in some Integration thread...
I am going to try doing some additional changes to my branch of the code to add some more support for adding MSC drives/partitions also wonder if they should apply to SD drives as well.
Examples of changes I am thinking about:
a) Something simple: (@WMXZ) - In MTP class I think that the Loop() method should instead use the Task method... That is if you look at all of our examples you will notice that in their loops they all do:
Code:
void loop()
{
myusb.Task();
b) Lots of stuff with MSC - First pass startup timing: Example maybe have some drives NOT at startup and/or when MSC Drive Insertion not at that time try to get the free/used space of the device, but wait to do that until after MTP is happy.. On at least a few thumb drives and maybe others this may take several seconds...
b1) I may first try a hack. Currently when I have an LittleFS drive do a format operation, I have an IntervalTimer looking for messages from the host, and this code always returns I am busy status... Wonder if I can get away with that now? That is maybe while we are looking at all of our devices at startup, have the background code try to stall the host, until we are ready for it... Currently if our startup is too slow both Windows and especially Linux won't show anything nor recover.
c) Partitions - Especially with USB Drives, but maybe also SDCards? At startup and/or insertion detection. Detect that there are multiple volumes on that device and if so maybe add storage for each one. Have some pieces in place with SDFat and MSC stuff, but not in the integration. Currently SDFat code has FatPartion and EXPartion classes, but no unifier in the FsLib (i.e no FsPartition.h/cpp files) that work with either in the same way as FsVolume works with FatVolume and ExFatVolume...
d) Again more MSC specific although again could apply to SDCards, like cards you use for RPI have multiple partitions, although so far we don't handle any of the linux file formats...
d1) Wondering about MSC object(s), How should the functionality be factored. More later in MSC thread... Or again wondering if makes sense to talk about all of this in some Integration thread...