Present images as USB storage on RP2 platform #501
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds the ini configuration option USBMassStoragePresentImages.
If set, MSC will present all configured eligible images as LUNs. If no images are available, it will fall back to presenting the SD card as storage. Eligibility is defined by if the image can be expected to contain a partition table or not; we can't put an optical device as a removable drive.
NOTE: This will fail to compile as currently presented. This is due to the platform MSC needing to pull in ZuluSCSI_disk.h in order to understand the image_config_t structure. ZuluSCSI_disk.h tries to pull in CUEParser.h but fails to compile as PlatformIO does not seem to pull in libraries while compiling the platform specific code.
Not sure of the best way to resolve this.
UI could be improved: A method to switch between presenting SD card and images at runtime would be useful. Otherwise, it is not possible to switch back to card reader mode if you set the .ini setting using USB in the first place.
ZuluSCSI V1.x (GD32) platform uCs are not currently supported. It would be possible to do so, however the libraries provided by gigadevice would need to be restructured in order to track capacity/block size/eject status on a per-LUN basis rather than global.