summaryrefslogtreecommitdiff
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 @@
31#include "button.h" 31#include "button.h"
32#include "backlight-target.h" 32#include "backlight-target.h"
33#include "lcd.h" 33#include "lcd.h"
34#include "filesystem-hosted.h"
34 35
35/* to make thread-internal.h happy */ 36/* to make thread-internal.h happy */
36uintptr_t *stackbegin; 37uintptr_t *stackbegin;
37uintptr_t *stackend; 38uintptr_t *stackend;
38 39
40/* forward-declare */
41bool os_file_exists(const char *ospath);
42
39static void sig_handler(int sig, siginfo_t *siginfo, void *context) 43static void sig_handler(int sig, siginfo_t *siginfo, void *context)
40{ 44{
41 /* safe guard variable - we call backtrace() only on first 45 /* safe guard variable - we call backtrace() only on first
@@ -134,17 +138,29 @@ bool hostfs_removable(IF_MD_NONVOID(int drive))
134 return true; 138 return true;
135 else 139 else
136#endif 140#endif
141#ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN
142 return true;
143#else
137 return false; /* internal: always present */ 144 return false; /* internal: always present */
145#endif
138} 146}
139 147
140bool hostfs_present(IF_MD_NONVOID(int drive)) 148bool hostfs_present(IF_MD_NONVOID(int drive))
141{ 149{
142#ifdef HAVE_MULTIDRIVE 150#ifdef HAVE_MULTIDRIVE
143 if (drive > 0) /* Active LOW */ 151 if (drive > 0)
144 return true; //FIXME 152#if defined(MULTIDRIVE_DEV)
153 return os_file_exists(MULTIDRIVE_DEV);
154#else
155 return true; // FIXME?
156#endif
145 else 157 else
146#endif 158#endif
159#ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN
160 return os_file_exists(ROOTDRIVE_DEV);
161#else
147 return true; /* internal: always present */ 162 return true; /* internal: always present */
163#endif
148} 164}
149 165
150#ifdef HAVE_MULTIDRIVE 166#ifdef HAVE_MULTIDRIVE