-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(usbmsc): Add is_writable function to the USBMSC class. #9569
Conversation
Add is_writable function to the USBMSC class. Allows USBMSC to be mounted in read-only mode.
👋 Hello happycodefarm, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
@happycodefarm The master branch targets the new 3.0.0 version. Could you please test these changes with this version ? |
@lucasssvaz, I can confirm that it works on the new 3.0.0 version. I'll update the Test Scenario according. |
@happycodefarm - Do you mind, please, adding a well commented example about how to use this new MSC feature? |
@happycodefarm - Please press the |
Changes to USB Mass Storage (MSC) example code in Arduino USB library * Added MSC.isWritable(true) line to set the disk as writable
@SuGlider - No problems, I updated the USBMSC.ino example in the pull request (and signed the CLA), is this enough of an example? |
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
Thanks, @happycodefarm. This is fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works fine. LGTM. @me-no-dev - Please merge it.
@happycodefarm - Thanks for the contribution! |
Description of Change
Add is_writable function to the USBMSC class.
Expose the tinyusb tud_msc_is_writable_cb callback function to the USBMSC class.
Allows to mount an MSC in read-only mode.
eg :
MSC.mediaPresent(true);
MSC.isWritable(false); // make it read-only
MSC.begin(DISK_SECTOR_COUNT, DISK_SECTOR_SIZE);
Tests scenarios
tested on Arduino-esp32 core v3.0.0 rc1 with and ESP32-S3 Board with this scenario