diff options
-rw-r--r-- | firmware/SOURCES | 2 | ||||
-rw-r--r-- | firmware/storage-sim.c | 118 | ||||
-rw-r--r-- | uisimulator/common/stubs.c | 36 |
3 files changed, 16 insertions, 140 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES index 7bd809ca60..567fa1c579 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -122,8 +122,6 @@ drivers/fat.c | |||
122 | #if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD) | 122 | #if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD) |
123 | hotswap.c | 123 | hotswap.c |
124 | #endif | 124 | #endif |
125 | #else /* SIMULATOR */ | ||
126 | storage-sim.c | ||
127 | #endif /* SIMULATOR */ | 125 | #endif /* SIMULATOR */ |
128 | 126 | ||
129 | /* EEPROM */ | 127 | /* EEPROM */ |
diff --git a/firmware/storage-sim.c b/firmware/storage-sim.c deleted file mode 100644 index 24b3f18b4e..0000000000 --- a/firmware/storage-sim.c +++ /dev/null | |||
@@ -1,118 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id: $ | ||
9 | * | ||
10 | * Copyright (C) 2008 by Frank Gevaerts | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #include "config.h" /* for HAVE_MULTIVOLUME or not */ | ||
22 | #include "storage.h" | ||
23 | |||
24 | #ifdef SIMULATOR | ||
25 | void storage_enable(bool on) | ||
26 | { | ||
27 | (void)on; | ||
28 | } | ||
29 | void storage_sleep(void) | ||
30 | { | ||
31 | } | ||
32 | void storage_sleepnow(void) | ||
33 | { | ||
34 | } | ||
35 | bool storage_disk_is_active(void) | ||
36 | { | ||
37 | return 0; | ||
38 | } | ||
39 | int storage_hard_reset(void) | ||
40 | { | ||
41 | return 0; | ||
42 | } | ||
43 | int storage_soft_reset(void) | ||
44 | { | ||
45 | return 0; | ||
46 | } | ||
47 | int storage_init(void) | ||
48 | { | ||
49 | return 0; | ||
50 | } | ||
51 | void storage_close(void) | ||
52 | { | ||
53 | } | ||
54 | int storage_read_sectors(int drive, unsigned long start, int count, void* buf) | ||
55 | { | ||
56 | (void)drive; | ||
57 | (void)start; | ||
58 | (void)count; | ||
59 | (void)buf; | ||
60 | return 0; | ||
61 | } | ||
62 | int storage_write_sectors(int drive, unsigned long start, int count, const void* buf) | ||
63 | { | ||
64 | (void)drive; | ||
65 | (void)start; | ||
66 | (void)count; | ||
67 | (void)buf; | ||
68 | return 0; | ||
69 | } | ||
70 | |||
71 | void storage_spin(void) | ||
72 | { | ||
73 | } | ||
74 | void storage_spindown(int seconds) | ||
75 | { | ||
76 | (void)seconds; | ||
77 | } | ||
78 | |||
79 | #if (CONFIG_LED == LED_REAL) | ||
80 | void storage_set_led_enabled(bool enabled) | ||
81 | { | ||
82 | (void)enabled; | ||
83 | } | ||
84 | #endif /*LED*/ | ||
85 | |||
86 | long storage_last_disk_activity(void) | ||
87 | { | ||
88 | return 0; | ||
89 | } | ||
90 | |||
91 | int storage_spinup_time(void) | ||
92 | { | ||
93 | return 0; | ||
94 | } | ||
95 | |||
96 | #ifdef STORAGE_GET_INFO | ||
97 | void storage_get_info(int drive, struct storage_info *info) | ||
98 | { | ||
99 | (void)drive; | ||
100 | (void)info; | ||
101 | } | ||
102 | #endif | ||
103 | |||
104 | #ifdef HAVE_HOTSWAP | ||
105 | bool storage_removable(int drive) | ||
106 | { | ||
107 | (void)drive; | ||
108 | return 0; | ||
109 | } | ||
110 | |||
111 | bool storage_present(int drive) | ||
112 | { | ||
113 | (void)drive; | ||
114 | return 0; | ||
115 | } | ||
116 | #endif /* HOTSWAP */ | ||
117 | |||
118 | #endif | ||
diff --git a/uisimulator/common/stubs.c b/uisimulator/common/stubs.c index 7b630eb25b..169ce06067 100644 --- a/uisimulator/common/stubs.c +++ b/uisimulator/common/stubs.c | |||
@@ -33,7 +33,7 @@ | |||
33 | #include "ata.h" /* for volume definitions */ | 33 | #include "ata.h" /* for volume definitions */ |
34 | 34 | ||
35 | extern char having_new_lcd; | 35 | extern char having_new_lcd; |
36 | static bool ata_spinning = false; | 36 | static bool storage_spinning = false; |
37 | 37 | ||
38 | #if CONFIG_CODEC != SWCODEC | 38 | #if CONFIG_CODEC != SWCODEC |
39 | void audio_set_buffer_margin(int seconds) | 39 | void audio_set_buffer_margin(int seconds) |
@@ -53,7 +53,12 @@ bool fat_ismounted(int volume) | |||
53 | return true; | 53 | return true; |
54 | } | 54 | } |
55 | 55 | ||
56 | int ata_write_sectors(IF_MV2(int drive,) | 56 | int storage_init(void) |
57 | { | ||
58 | return 1; | ||
59 | } | ||
60 | |||
61 | int storage_write_sectors(IF_MV2(int drive,) | ||
57 | unsigned long start, | 62 | unsigned long start, |
58 | int count, | 63 | int count, |
59 | const void* buf) | 64 | const void* buf) |
@@ -75,7 +80,7 @@ int ata_write_sectors(IF_MV2(int drive,) | |||
75 | return 1; | 80 | return 1; |
76 | } | 81 | } |
77 | 82 | ||
78 | int ata_read_sectors(IF_MV2(int drive,) | 83 | int storage_read_sectors(IF_MV2(int drive,) |
79 | unsigned long start, | 84 | unsigned long start, |
80 | int count, | 85 | int count, |
81 | void* buf) | 86 | void* buf) |
@@ -98,34 +103,25 @@ int ata_read_sectors(IF_MV2(int drive,) | |||
98 | return 1; | 103 | return 1; |
99 | } | 104 | } |
100 | 105 | ||
101 | void ata_delayed_write(unsigned long sector, const void* buf) | 106 | void storage_spin(void) |
102 | { | ||
103 | ata_write_sectors(IF_MV2(0,) sector, 1, buf); | ||
104 | } | ||
105 | |||
106 | void ata_flush(void) | ||
107 | { | ||
108 | } | ||
109 | |||
110 | void ata_spin(void) | ||
111 | { | 107 | { |
112 | ata_spinning = true; | 108 | storage_spinning = true; |
113 | } | 109 | } |
114 | 110 | ||
115 | void ata_sleep(void) | 111 | void storage_sleep(void) |
116 | { | 112 | { |
117 | DEBUGF("ata_sleep()\n"); | 113 | DEBUGF("storage_sleep()\n"); |
118 | } | 114 | } |
119 | 115 | ||
120 | bool ata_disk_is_active(void) | 116 | bool storage_disk_is_active(void) |
121 | { | 117 | { |
122 | return ata_spinning; | 118 | return storage_spinning; |
123 | } | 119 | } |
124 | 120 | ||
125 | void ata_spindown(int s) | 121 | void storage_spindown(int s) |
126 | { | 122 | { |
127 | (void)s; | 123 | (void)s; |
128 | ata_spinning = false; | 124 | storage_spinning = false; |
129 | } | 125 | } |
130 | 126 | ||
131 | void rtc_init(void) | 127 | void rtc_init(void) |