refactor(tinyusb_msc): Device callbacks #178
Draft
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.
Requirements
Reference link: https://esp32.com/viewtopic.php?f=13&t=34535
Reference link: espressif/idf-extra-components#210 (review)
Description
This is a refactoring of currently present logic of MSC storage callbacks.
Changes simplify the callback logic by:
Key Features
tusb_msc_storage.c
. Now, the spiflash and sdmmc have their own storage logic, available by the common API for the MSC storage.tusb_msc_storage.c
totinyusb_msc.c
. The rule is: all the upstream code from TinyUSB starts withtusb_*
all additional code from our side starts withtinyusb_*
. For example:tinyusb_task.c
,tinyusb_msc.c
and so on.TINYUSB_MSC_STORAGE_TYPE_SPIFLASH
orTINYUSB_MSC_STORAGE_TYPE_SDMMC
. Only one function for the driver installation:tinyusb_msc_storage_init(&config)
.config.mount_point = TINYUSB_MSC_STORAGE_MOUNT_APP
, and after driver installation the storage will be mounted to the APP. Valuable, when device is self_powered and we need to access the storage from the APP before the devicewill be connected to the USB Host.
Related
Testing
msc_storage
, based on the spiflash that verifies the callbacks presence, mounting logic and memory leakages during intall/uninstall.Checklist
Before submitting a Pull Request, please ensure the following: