summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/root_menu.c5
-rw-r--r--firmware/common/disk.c16
-rw-r--r--firmware/export/disk.h5
3 files changed, 24 insertions, 2 deletions
diff --git a/apps/root_menu.c b/apps/root_menu.c
index 1ffde91eb7..71844dd41a 100644
--- a/apps/root_menu.c
+++ b/apps/root_menu.c
@@ -71,6 +71,7 @@
71#endif 71#endif
72#include "language.h" 72#include "language.h"
73#include "plugin.h" 73#include "plugin.h"
74#include "disk.h"
74 75
75struct root_items { 76struct root_items {
76 int (*function)(void* param); 77 int (*function)(void* param);
@@ -131,12 +132,12 @@ static int browser(void* param)
131 for (i = 0; i < NUM_VOLUMES; i++) 132 for (i = 0; i < NUM_VOLUMES; i++)
132 { 133 {
133 char vol_string[VOL_ENUM_POS + 8]; 134 char vol_string[VOL_ENUM_POS + 8];
134 if (!storage_removable(i)) 135 if (!volume_removable(i))
135 continue; 136 continue;
136 /* VOL_NAMES contains a %d */ 137 /* VOL_NAMES contains a %d */
137 snprintf(vol_string, sizeof(vol_string), "/"VOL_NAMES, i); 138 snprintf(vol_string, sizeof(vol_string), "/"VOL_NAMES, i);
138 /* test whether we would browse the external card */ 139 /* test whether we would browse the external card */
139 if (!storage_present(i) && 140 if (!volume_present(i) &&
140 (strstr(last_folder, vol_string) 141 (strstr(last_folder, vol_string)
141#ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN 142#ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN
142 || (i == 0) 143 || (i == 0)
diff --git a/firmware/common/disk.c b/firmware/common/disk.c
index fb6daee174..5a55a3b6ac 100644
--- a/firmware/common/disk.c
+++ b/firmware/common/disk.c
@@ -292,3 +292,19 @@ int disk_unmount_all(void)
292 return unmounted; 292 return unmounted;
293#endif /* HAVE_MULTIDRIVE */ 293#endif /* HAVE_MULTIDRIVE */
294} 294}
295
296#ifdef HAVE_HOTSWAP
297bool volume_removable(int volume)
298{
299 if(vol_drive[volume] == -1)
300 return false;
301 return storage_removable(vol_drive[volume]);
302}
303
304bool volume_present(int volume)
305{
306 if(vol_drive[volume] == -1)
307 return false;
308 return storage_present(vol_drive[volume]);
309}
310#endif
diff --git a/firmware/export/disk.h b/firmware/export/disk.h
index 8d6b41b5bd..b97ec11039 100644
--- a/firmware/export/disk.h
+++ b/firmware/export/disk.h
@@ -50,4 +50,9 @@ int disk_unmount(int drive);
50int disk_get_sector_multiplier(IF_MD_NONVOID(int drive)); 50int disk_get_sector_multiplier(IF_MD_NONVOID(int drive));
51#endif 51#endif
52 52
53#ifdef HAVE_HOTSWAP
54bool volume_removable(int volume);
55bool volume_present(int volume);
56#endif
57
53#endif 58#endif