summaryrefslogtreecommitdiff
path: root/supervisor/shared
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2020-02-12 10:33:15 -0800
committerGitHub <noreply@github.com>2020-02-12 10:33:15 -0800
commit8e8eb077917ef2e6d417df4eb7959feb1bc6a35a (patch)
tree4cfe510453346992528b2322f3100e6713a8e8ad /supervisor/shared
parentfb8fbbf42e2cc54722631bd79d5f16b8d235b640 (diff)
parent07708f15185d96930621493c3e2886cc2e948622 (diff)
Merge pull request #2606 from aramcon-badge/usb-remount-fix
Fix to allow remount when usb enabled but not msc
Diffstat (limited to 'supervisor/shared')
-rw-r--r--supervisor/shared/usb/usb_msc_flash.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/supervisor/shared/usb/usb_msc_flash.c b/supervisor/shared/usb/usb_msc_flash.c
index 0376cfc1d..c0279f9e5 100644
--- a/supervisor/shared/usb/usb_msc_flash.c
+++ b/supervisor/shared/usb/usb_msc_flash.c
@@ -39,7 +39,7 @@
#define MSC_FLASH_BLOCK_SIZE 512
-static bool ejected[1];
+static bool ejected[1] = {true};
void usb_msc_mount(void) {
// Reset the ejection tracking every time we're plugged into USB. This allows for us to battery
@@ -53,6 +53,14 @@ void usb_msc_umount(void) {
}
+bool usb_msc_ejected(void) {
+ bool all_ejected = true;
+ for (uint8_t i = 0; i < sizeof(ejected); i++) {
+ all_ejected &= ejected[i];
+ }
+ return all_ejected;
+}
+
// The root FS is always at the end of the list.
static fs_user_mount_t* get_vfs(int lun) {
// TODO(tannewt): Return the mount which matches the lun where 0 is the end