diff options
Diffstat (limited to 'firmware/target/hosted/ibasso/system-ibasso.c')
-rw-r--r-- | firmware/target/hosted/ibasso/system-ibasso.c | 55 |
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 @@ | |||
39 | uintptr_t* stackbegin; | 40 | uintptr_t* stackbegin; |
40 | uintptr_t* stackend; | 41 | uintptr_t* stackend; |
41 | 42 | ||
43 | /* forward-declare */ | ||
44 | bool os_file_exists(const char *ospath); | ||
42 | 45 | ||
43 | void system_init(void) | 46 | void 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 | |||
102 | bool 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 | ||
113 | int volume_drive(int drive) | ||
114 | { | ||
115 | return drive; | ||
116 | } | ||
117 | #endif /* HAVE_MULTIDRIVE */ | ||
118 | |||
119 | #ifdef CONFIG_STORAGE_MULTI | ||
120 | int hostfs_driver_type(int drive) | ||
121 | { | ||
122 | return drive > 0 ? STORAGE_SD_NUM : STORAGE_HOSTFS_NUM; | ||
123 | } | ||
124 | #endif /* CONFIG_STORAGE_MULTI */ | ||
125 | |||
126 | bool 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 | ||
141 | bool volume_removable(int volume) | ||
142 | { | ||
143 | /* don't support more than one partition yet, so volume == drive */ | ||
144 | return hostfs_removable(volume); | ||
145 | } | ||
146 | |||
147 | bool 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 | ||