SingleFileDrive Control #1943
Unanswered
NuclearPhoenixx
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As I understand, the SingleFileDrive presents the file contents from a LittleFS file as a file on its own little emulated mass storage device as soon as it detects a USB interrupt. The LittleFS file has to be specified at the very beginning of the file. The Pico is a little bit at the mercy of the device it's plugged in here since it cannot do any LittleFS actions during this time and it also cannot terminate the connection from its end.
Now, is there any way to present or hide (like soft plug/unplug) the mass storage device in software on the Pico, given it's plugged in of course? I mean instead of automatically doing so everytime the USB connection is (un)plugged. This would allow the drive to disconnect after some time for example if it sits idle for too long and reconnect once there is some kind of serial command.
This function might also allow the software to change the file it wants to show which is really the main point my question is about. You could soft-unplug, change the file, and then re-plug to show a new file. This would somewhat circumvent the single file limit of the library. I'm thinking of plugging the Pico into a computer -- nothing happens. Then the user sends a serial command to load a specific file -- this file then plops up on the computer. The user wants to show a different file (again via the serial command) -- soft-unplug, change the file, and then re-plug.
I'm not sure if this is already possible or if it would be even feasible to do with the library. If someone has some tips for me, I'd be more than happy :)
Beta Was this translation helpful? Give feedback.
All reactions