summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/ibasso/system-ibasso.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/ibasso/system-ibasso.c')
-rw-r--r--firmware/target/hosted/ibasso/system-ibasso.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/firmware/target/hosted/ibasso/system-ibasso.c b/firmware/target/hosted/ibasso/system-ibasso.c
index 45a6514aa2..401bb3c442 100644
--- a/firmware/target/hosted/ibasso/system-ibasso.c
+++ b/firmware/target/hosted/ibasso/system-ibasso.c
@@ -28,6 +28,7 @@
28 28
29#include "config.h" 29#include "config.h"
30#include "debug.h" 30#include "debug.h"
31#include "mv.h"
31 32
32#include "button-ibasso.h" 33#include "button-ibasso.h"
33#include "debug-ibasso.h" 34#include "debug-ibasso.h"
@@ -39,6 +40,8 @@
39uintptr_t* stackbegin; 40uintptr_t* stackbegin;
40uintptr_t* stackend; 41uintptr_t* stackend;
41 42
43/* forward-declare */
44bool os_file_exists(const char *ospath);
42 45
43void system_init(void) 46void system_init(void)
44{ 47{
@@ -95,3 +98,55 @@ void system_exception_wait(void)
95 98
96 while(1) {}; 99 while(1) {};
97} 100}
101
102bool hostfs_removable(IF_MD_NONVOID(int drive))
103{
104#ifdef HAVE_MULTIDRIVE
105 if (drive > 0)
106 return true;
107 else
108#endif
109 return false; /* internal: always present */
110}
111
112#ifdef HAVE_MULTIDRIVE
113int volume_drive(int drive)
114{
115 return drive;
116}
117#endif /* HAVE_MULTIDRIVE */
118
119#ifdef CONFIG_STORAGE_MULTI
120int hostfs_driver_type(int drive)
121{
122 return drive > 0 ? STORAGE_SD_NUM : STORAGE_HOSTFS_NUM;
123}
124#endif /* CONFIG_STORAGE_MULTI */
125
126bool hostfs_present(IF_MD_NONVOID(int drive))
127{
128#ifdef HAVE_MULTIDRIVE
129 if (drive > 0)
130#if defined(MULTIDRIVE_DEV)
131 return os_file_exists(MULTIDRIVE_DEV);
132#else
133 return extsd_present;
134#endif
135 else
136#endif
137 return true; /* internal: always present */
138}
139
140#ifdef HAVE_HOTSWAP
141bool volume_removable(int volume)
142{
143 /* don't support more than one partition yet, so volume == drive */
144 return hostfs_removable(volume);
145}
146
147bool volume_present(int volume)
148{
149 /* don't support more than one partition yet, so volume == drive */
150 return hostfs_present(volume);
151}
152#endif