diff options
-rw-r--r-- | firmware/export/storage.h | 96 |
1 files changed, 90 insertions, 6 deletions
diff --git a/firmware/export/storage.h b/firmware/export/storage.h index 8a0219c523..78d3360ba9 100644 --- a/firmware/export/storage.h +++ b/firmware/export/storage.h | |||
@@ -50,6 +50,7 @@ struct storage_info | |||
50 | 50 | ||
51 | void storage_spindown(int seconds); | 51 | void storage_spindown(int seconds); |
52 | 52 | ||
53 | #ifndef SIMULATOR | ||
53 | static inline void storage_enable(bool on) | 54 | static inline void storage_enable(bool on) |
54 | { | 55 | { |
55 | #if (CONFIG_STORAGE & STORAGE_ATA) | 56 | #if (CONFIG_STORAGE & STORAGE_ATA) |
@@ -102,7 +103,6 @@ static inline int storage_soft_reset(void) | |||
102 | } | 103 | } |
103 | static inline int storage_init(void) | 104 | static inline int storage_init(void) |
104 | { | 105 | { |
105 | #ifndef SIMULATOR | ||
106 | #if (CONFIG_STORAGE & STORAGE_ATA) | 106 | #if (CONFIG_STORAGE & STORAGE_ATA) |
107 | return ata_init(); | 107 | return ata_init(); |
108 | #elif (CONFIG_STORAGE & STORAGE_SD) | 108 | #elif (CONFIG_STORAGE & STORAGE_SD) |
@@ -114,9 +114,6 @@ static inline int storage_init(void) | |||
114 | #else | 114 | #else |
115 | #error No storage driver! | 115 | #error No storage driver! |
116 | #endif | 116 | #endif |
117 | #else | ||
118 | return 0; | ||
119 | #endif | ||
120 | } | 117 | } |
121 | static inline void storage_close(void) | 118 | static inline void storage_close(void) |
122 | { | 119 | { |
@@ -174,7 +171,7 @@ static inline void storage_set_led_enabled(bool enabled) | |||
174 | #error No storage driver! | 171 | #error No storage driver! |
175 | #endif | 172 | #endif |
176 | } | 173 | } |
177 | #endif | 174 | #endif /*LED*/ |
178 | 175 | ||
179 | static inline long storage_last_disk_activity(void) | 176 | static inline long storage_last_disk_activity(void) |
180 | { | 177 | { |
@@ -245,5 +242,92 @@ static inline bool storage_present(IF_MV_NONVOID(int drive)) | |||
245 | #error No storage driver! | 242 | #error No storage driver! |
246 | #endif | 243 | #endif |
247 | } | 244 | } |
248 | #endif | 245 | #endif /* HOTSWAP */ |
246 | #else /* SIMULATOR */ | ||
247 | static inline void storage_enable(bool on) | ||
248 | { | ||
249 | (void)on; | ||
250 | } | ||
251 | static inline void storage_sleep(void) | ||
252 | { | ||
253 | } | ||
254 | static inline void storage_sleepnow(void) | ||
255 | { | ||
256 | } | ||
257 | static inline bool storage_disk_is_active(void) | ||
258 | { | ||
259 | return 0; | ||
260 | } | ||
261 | static inline int storage_hard_reset(void) | ||
262 | { | ||
263 | return 0; | ||
264 | } | ||
265 | static inline int storage_soft_reset(void) | ||
266 | { | ||
267 | return 0; | ||
268 | } | ||
269 | static inline int storage_init(void) | ||
270 | { | ||
271 | return 0; | ||
272 | } | ||
273 | static inline void storage_close(void) | ||
274 | { | ||
275 | } | ||
276 | static inline int storage_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf) | ||
277 | { | ||
278 | IF_MV((void)drive;) | ||
279 | (void)start; | ||
280 | (void)count; | ||
281 | (void)buf; | ||
282 | return 0; | ||
283 | } | ||
284 | static inline int storage_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf) | ||
285 | { | ||
286 | IF_MV((void)drive;) | ||
287 | (void)start; | ||
288 | (void)count; | ||
289 | (void)buf; | ||
290 | return 0; | ||
291 | } | ||
292 | static inline void storage_spin(void) | ||
293 | { | ||
294 | } | ||
295 | |||
296 | #if (CONFIG_LED == LED_REAL) | ||
297 | static inline void storage_set_led_enabled(bool enabled) | ||
298 | { | ||
299 | (void)enabled; | ||
300 | } | ||
301 | #endif /*LED*/ | ||
302 | |||
303 | static inline long storage_last_disk_activity(void) | ||
304 | { | ||
305 | return 0; | ||
306 | } | ||
307 | |||
308 | static inline int storage_spinup_time(void) | ||
309 | { | ||
310 | return 0; | ||
311 | } | ||
312 | |||
313 | static inline void storage_get_info(IF_MV2(int drive,) struct storage_info *info) | ||
314 | { | ||
315 | IF_MV((void)drive;) | ||
316 | (void)info; | ||
317 | } | ||
318 | |||
319 | #ifdef HAVE_HOTSWAP | ||
320 | static inline bool storage_removable(IF_MV_NONVOID(int drive)) | ||
321 | { | ||
322 | IF_MV((void)drive;) | ||
323 | return 0; | ||
324 | } | ||
325 | |||
326 | static inline bool storage_present(IF_MV_NONVOID(int drive)) | ||
327 | { | ||
328 | IF_MV((void)drive;) | ||
329 | return 0; | ||
330 | } | ||
331 | #endif /* HOTSWAP */ | ||
332 | #endif /* SIMULATOR */ | ||
249 | #endif | 333 | #endif |