diff options
-rw-r--r-- | apps/plugin.c | 4 | ||||
-rw-r--r-- | apps/settings_list.c | 2 | ||||
-rw-r--r-- | firmware/export/storage.h | 33 |
3 files changed, 20 insertions, 19 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index 7d40a8db4f..4293d861f9 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -421,8 +421,8 @@ static const struct plugin_api rockbox_api = { | |||
421 | read_line, | 421 | read_line, |
422 | settings_parseline, | 422 | settings_parseline, |
423 | storage_sleep, | 423 | storage_sleep, |
424 | storage_spin, | 424 | STORAGE_FUNCTION(spin), |
425 | storage_spindown, | 425 | STORAGE_FUNCTION(spindown), |
426 | #if USING_STORAGE_CALLBACK | 426 | #if USING_STORAGE_CALLBACK |
427 | register_storage_idle_func, | 427 | register_storage_idle_func, |
428 | unregister_storage_idle_func, | 428 | unregister_storage_idle_func, |
diff --git a/apps/settings_list.c b/apps/settings_list.c index bc03672aeb..435a09bb8a 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c | |||
@@ -1255,7 +1255,7 @@ const struct settings_list settings[] = { | |||
1255 | /* disk */ | 1255 | /* disk */ |
1256 | #ifdef HAVE_DISK_STORAGE | 1256 | #ifdef HAVE_DISK_STORAGE |
1257 | INT_SETTING(F_TIME_SETTING, disk_spindown, LANG_SPINDOWN, 5, "disk spindown", | 1257 | INT_SETTING(F_TIME_SETTING, disk_spindown, LANG_SPINDOWN, 5, "disk spindown", |
1258 | UNIT_SEC, 3, 254, 1, NULL, NULL, storage_spindown), | 1258 | UNIT_SEC, 3, 254, 1, NULL, NULL, STORAGE_FUNCTION(spindown)), |
1259 | #endif /* HAVE_DISK_STORAGE */ | 1259 | #endif /* HAVE_DISK_STORAGE */ |
1260 | /* browser */ | 1260 | /* browser */ |
1261 | TEXT_SETTING(0, start_directory, "start directory", "/", NULL, NULL), | 1261 | TEXT_SETTING(0, start_directory, "start directory", "/", NULL, NULL), |
diff --git a/firmware/export/storage.h b/firmware/export/storage.h index 8ff06c8744..e6424f7b03 100644 --- a/firmware/export/storage.h +++ b/firmware/export/storage.h | |||
@@ -118,11 +118,12 @@ static inline void stub_storage_spin(void) {} | |||
118 | static inline void stub_storage_spindown(int timeout) { (void)timeout; } | 118 | static inline void stub_storage_spindown(int timeout) { (void)timeout; } |
119 | static inline int stub_storage_event(long id, intptr_t data) | 119 | static inline int stub_storage_event(long id, intptr_t data) |
120 | { return 0; (void)id; (void)data; } | 120 | { return 0; (void)id; (void)data; } |
121 | static inline void storage_sleep(void) {}; | ||
121 | #else /* ndef HAVE_HOSTFS */ | 122 | #else /* ndef HAVE_HOSTFS */ |
122 | #if (CONFIG_STORAGE & STORAGE_ATA) | 123 | #if (CONFIG_STORAGE & STORAGE_ATA) |
123 | void storage_sleep(void); | 124 | void storage_sleep(void); |
124 | #else | 125 | #else |
125 | static inline void storage_sleep(void) {} | 126 | static inline void storage_sleep(void) {}; |
126 | #endif | 127 | #endif |
127 | #endif /* HAVE_HOSTFS */ | 128 | #endif /* HAVE_HOSTFS */ |
128 | 129 | ||
@@ -132,11 +133,11 @@ static inline void storage_sleep(void) {} | |||
132 | */ | 133 | */ |
133 | #define storage_num_drives() NUM_DRIVES | 134 | #define storage_num_drives() NUM_DRIVES |
134 | #if defined(HAVE_HOSTFS) | 135 | #if defined(HAVE_HOSTFS) |
135 | #define STORAGE_FUNCTION(NAME) (stub_## NAME) | 136 | #define STORAGE_FUNCTION(NAME) (stub_storage_## NAME) |
136 | #define storage_event stub_storage_event | 137 | #define storage_event stub_storage_event |
137 | #define storage_spindown stub_storage_spindown | 138 | #define storage_spindown(sec) stub_storage_spindown(sec) |
138 | #define storage_sleep stub_storage_sleep | 139 | #define storage_sleep() stub_storage_sleep() |
139 | #define storage_spin stub_storage_spin | 140 | #define storage_spin() stub_storage_spin() |
140 | 141 | ||
141 | #define storage_enable(on) | 142 | #define storage_enable(on) |
142 | #define storage_sleepnow() | 143 | #define storage_sleepnow() |
@@ -160,9 +161,8 @@ static inline void storage_sleep(void) {} | |||
160 | #define storage_driver_type(drive) hostfs_driver_type(IF_MV(drive)) | 161 | #define storage_driver_type(drive) hostfs_driver_type(IF_MV(drive)) |
161 | #elif (CONFIG_STORAGE & STORAGE_ATA) | 162 | #elif (CONFIG_STORAGE & STORAGE_ATA) |
162 | #define STORAGE_FUNCTION(NAME) (ata_## NAME) | 163 | #define STORAGE_FUNCTION(NAME) (ata_## NAME) |
163 | #define storage_spindown ata_spindown | 164 | #define storage_spindown(sec) ata_spindown(sec) |
164 | #define storage_spin ata_spin | 165 | #define storage_spin() ata_spin() |
165 | |||
166 | #define storage_enable(on) ata_enable(on) | 166 | #define storage_enable(on) ata_enable(on) |
167 | #define storage_sleepnow() ata_sleepnow() | 167 | #define storage_sleepnow() ata_sleepnow() |
168 | #define storage_disk_is_active() ata_disk_is_active() | 168 | #define storage_disk_is_active() ata_disk_is_active() |
@@ -184,8 +184,8 @@ static inline void storage_sleep(void) {} | |||
184 | #define storage_driver_type(drive) (STORAGE_ATA_NUM) | 184 | #define storage_driver_type(drive) (STORAGE_ATA_NUM) |
185 | #elif (CONFIG_STORAGE & STORAGE_SD) | 185 | #elif (CONFIG_STORAGE & STORAGE_SD) |
186 | #define STORAGE_FUNCTION(NAME) (sd_## NAME) | 186 | #define STORAGE_FUNCTION(NAME) (sd_## NAME) |
187 | #define storage_spindown sd_spindown | 187 | #define storage_spindown(sec) sd_spindown(sec) |
188 | #define storage_spin sd_spin | 188 | #define storage_spin() sd_spin() |
189 | 189 | ||
190 | #define storage_enable(on) sd_enable(on) | 190 | #define storage_enable(on) sd_enable(on) |
191 | #define storage_sleepnow() do {} while (0) | 191 | #define storage_sleepnow() do {} while (0) |
@@ -208,8 +208,8 @@ static inline void storage_sleep(void) {} | |||
208 | #define storage_driver_type(drive) (STORAGE_SD_NUM) | 208 | #define storage_driver_type(drive) (STORAGE_SD_NUM) |
209 | #elif (CONFIG_STORAGE & STORAGE_MMC) | 209 | #elif (CONFIG_STORAGE & STORAGE_MMC) |
210 | #define STORAGE_FUNCTION(NAME) (mmc_## NAME) | 210 | #define STORAGE_FUNCTION(NAME) (mmc_## NAME) |
211 | #define storage_spindown mmc_spindown | 211 | #define storage_spindown(sec) mmc_spindown(sec) |
212 | #define storage_spin mmc_spin | 212 | #define storage_spin() mmc_spin() |
213 | 213 | ||
214 | #define storage_enable(on) mmc_enable(on) | 214 | #define storage_enable(on) mmc_enable(on) |
215 | #define storage_sleepnow() mmc_sleepnow() | 215 | #define storage_sleepnow() mmc_sleepnow() |
@@ -232,8 +232,8 @@ static inline void storage_sleep(void) {} | |||
232 | #define storage_driver_type(drive) (STORAGE_MMC_NUM) | 232 | #define storage_driver_type(drive) (STORAGE_MMC_NUM) |
233 | #elif (CONFIG_STORAGE & STORAGE_NAND) | 233 | #elif (CONFIG_STORAGE & STORAGE_NAND) |
234 | #define STORAGE_FUNCTION(NAME) (nand_## NAME) | 234 | #define STORAGE_FUNCTION(NAME) (nand_## NAME) |
235 | #define storage_spindown nand_spindown | 235 | #define storage_spindown(sec) nand_spindown(sec) |
236 | #define storage_spin nand_spin | 236 | #define storage_spin() nand_spin() |
237 | 237 | ||
238 | #define storage_enable(on) (void)0 | 238 | #define storage_enable(on) (void)0 |
239 | #define storage_sleepnow() nand_sleepnow() | 239 | #define storage_sleepnow() nand_sleepnow() |
@@ -256,8 +256,8 @@ static inline void storage_sleep(void) {} | |||
256 | #define storage_driver_type(drive) (STORAGE_NAND_NUM) | 256 | #define storage_driver_type(drive) (STORAGE_NAND_NUM) |
257 | #elif (CONFIG_STORAGE & STORAGE_RAMDISK) | 257 | #elif (CONFIG_STORAGE & STORAGE_RAMDISK) |
258 | #define STORAGE_FUNCTION(NAME) (ramdisk_## NAME) | 258 | #define STORAGE_FUNCTION(NAME) (ramdisk_## NAME) |
259 | #define storage_spindown ramdisk_spindown | 259 | #define storage_spindown(sec) ramdisk_spindown(sec) |
260 | #define storage_spin ramdisk_spin | 260 | #define storage_spin() ramdisk_spin() |
261 | 261 | ||
262 | #define storage_enable(on) (void)0 | 262 | #define storage_enable(on) (void)0 |
263 | #define storage_sleepnow() ramdisk_sleepnow() | 263 | #define storage_sleepnow() ramdisk_sleepnow() |
@@ -284,6 +284,7 @@ static inline void storage_sleep(void) {} | |||
284 | #else /* CONFIG_STORAGE_MULTI || !HAVE_HOSTFS */ | 284 | #else /* CONFIG_STORAGE_MULTI || !HAVE_HOSTFS */ |
285 | 285 | ||
286 | /* Multi-driver use normal functions */ | 286 | /* Multi-driver use normal functions */ |
287 | #define STORAGE_FUNCTION(NAME) (storage_## NAME) | ||
287 | 288 | ||
288 | void storage_enable(bool on); | 289 | void storage_enable(bool on); |
289 | void storage_sleepnow(void); | 290 | void storage_sleepnow(void); |