summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted/system-hosted.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/system-hosted.c')
-rw-r--r--firmware/target/hosted/system-hosted.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/firmware/target/hosted/system-hosted.c b/firmware/target/hosted/system-hosted.c
index f485dc4c15..fa492c1094 100644
--- a/firmware/target/hosted/system-hosted.c
+++ b/firmware/target/hosted/system-hosted.c
@@ -31,11 +31,15 @@
#include "button.h"
#include "backlight-target.h"
#include "lcd.h"
+#include "filesystem-hosted.h"
/* to make thread-internal.h happy */
uintptr_t *stackbegin;
uintptr_t *stackend;
+/* forward-declare */
+bool os_file_exists(const char *ospath);
+
static void sig_handler(int sig, siginfo_t *siginfo, void *context)
{
/* safe guard variable - we call backtrace() only on first
@@ -134,17 +138,29 @@ bool hostfs_removable(IF_MD_NONVOID(int drive))
return true;
else
#endif
+#ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN
+ return true;
+#else
return false; /* internal: always present */
+#endif
}
bool hostfs_present(IF_MD_NONVOID(int drive))
{
#ifdef HAVE_MULTIDRIVE
- if (drive > 0) /* Active LOW */
- return true; //FIXME
+ if (drive > 0)
+#if defined(MULTIDRIVE_DEV)
+ return os_file_exists(MULTIDRIVE_DEV);
+#else
+ return true; // FIXME?
+#endif
else
#endif
+#ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN
+ return os_file_exists(ROOTDRIVE_DEV);
+#else
return true; /* internal: always present */
+#endif
}
#ifdef HAVE_MULTIDRIVE