feat(tusb_msc): Add device mount/unmount callback #122
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.
Description
This MR adds a possibility to define a user callback for device mount/unmount events.
Right now, the
tusb_msc_storage.c
automatically calls:tinyusb_msc_storage_mount()
attud_umount_cb()
tinyusb_msc_storage_unmount()
attud_mount_cb()
User has no flexibility to do anything else upon the device mount/unmount.
This MR adds a flexibility to the user, to for example control an owership of the storage (eg, not to automatically unmount a storage when a USB device is plugged in)
Also cleaned conceptions between device mount/unmount and storage mount/unmount, not to confuse anyone when the code refers to device mount/unmount and when to storage mount/unmount.
Related
Related to #78
Testing
Checklist
Before submitting a Pull Request, please ensure the following: