diff options
author | Bertrik Sikken <bertrik@sikken.nl> | 2008-07-03 13:37:57 +0000 |
---|---|---|
committer | Bertrik Sikken <bertrik@sikken.nl> | 2008-07-03 13:37:57 +0000 |
commit | f4d4a6ab60960385b99fd43d8e1d0213bdf1aec3 (patch) | |
tree | a17522b121489fe8c52c40bd03f1ede2ccfcf8ab | |
parent | 6fd40a57b81484a57f1c5a8ddbd48855a89e660f (diff) | |
download | rockbox-f4d4a6ab60960385b99fd43d8e1d0213bdf1aec3.tar.gz rockbox-f4d4a6ab60960385b99fd43d8e1d0213bdf1aec3.zip |
Implement FS#8947 - Add a stub in the simulator for ata_disk_is_active. This make it possible to clean up some #ifdef SIMULATOR macros.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17927 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/plugin.c | 2 | ||||
-rw-r--r-- | apps/plugin.h | 2 | ||||
-rw-r--r-- | apps/recorder/peakmeter.c | 2 | ||||
-rw-r--r-- | apps/recorder/recording.c | 6 | ||||
-rw-r--r-- | apps/tagtree.c | 2 | ||||
-rw-r--r-- | uisimulator/common/stubs.c | 8 |
6 files changed, 11 insertions, 11 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index 38c95cd572..08beddf8fb 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -263,9 +263,7 @@ static const struct plugin_api rockbox_api = { | |||
263 | read_line, | 263 | read_line, |
264 | settings_parseline, | 264 | settings_parseline, |
265 | ata_sleep, | 265 | ata_sleep, |
266 | #ifndef SIMULATOR | ||
267 | ata_disk_is_active, | 266 | ata_disk_is_active, |
268 | #endif | ||
269 | ata_spin, | 267 | ata_spin, |
270 | ata_spindown, | 268 | ata_spindown, |
271 | reload_directory, | 269 | reload_directory, |
diff --git a/apps/plugin.h b/apps/plugin.h index 5223f85d2c..28c3d5a5a5 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -364,9 +364,7 @@ struct plugin_api { | |||
364 | int (*read_line)(int fd, char* buffer, int buffer_size); | 364 | int (*read_line)(int fd, char* buffer, int buffer_size); |
365 | bool (*settings_parseline)(char* line, char** name, char** value); | 365 | bool (*settings_parseline)(char* line, char** name, char** value); |
366 | void (*ata_sleep)(void); | 366 | void (*ata_sleep)(void); |
367 | #ifndef SIMULATOR | ||
368 | bool (*ata_disk_is_active)(void); | 367 | bool (*ata_disk_is_active)(void); |
369 | #endif | ||
370 | void (*ata_spin)(void); | 368 | void (*ata_spin)(void); |
371 | void (*ata_spindown)(int seconds); | 369 | void (*ata_spindown)(int seconds); |
372 | void (*reload_directory)(void); | 370 | void (*reload_directory)(void); |
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c index 29be704f0c..fc7c9bc5f5 100644 --- a/apps/recorder/peakmeter.c +++ b/apps/recorder/peakmeter.c | |||
@@ -1335,7 +1335,7 @@ int peak_meter_draw_get_btn(int action_context, int x, int y[], | |||
1335 | long next_refresh = current_tick; | 1335 | long next_refresh = current_tick; |
1336 | long next_big_refresh = current_tick + HZ / 10; | 1336 | long next_big_refresh = current_tick + HZ / 10; |
1337 | int i; | 1337 | int i; |
1338 | #if (CONFIG_CODEC == SWCODEC) || defined(SIMULATOR) | 1338 | #if (CONFIG_CODEC == SWCODEC) |
1339 | bool highperf = false; | 1339 | bool highperf = false; |
1340 | #else | 1340 | #else |
1341 | /* On MAS targets, we need to poll as often as possible in order to not | 1341 | /* On MAS targets, we need to poll as often as possible in order to not |
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index de4a2e6805..4afa87e5b6 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c | |||
@@ -292,11 +292,7 @@ static bool read_peak_levels(int *peak_l, int *peak_r, int *balance) | |||
292 | peak_valid_mem[peak_time % 3] = *peak_l; | 292 | peak_valid_mem[peak_time % 3] = *peak_l; |
293 | if (((peak_valid_mem[0] == peak_valid_mem[1]) && | 293 | if (((peak_valid_mem[0] == peak_valid_mem[1]) && |
294 | (peak_valid_mem[1] == peak_valid_mem[2])) && | 294 | (peak_valid_mem[1] == peak_valid_mem[2])) && |
295 | ((*peak_l < 32767) | 295 | ((*peak_l < 32767) || ata_disk_is_active())) |
296 | #ifndef SIMULATOR | ||
297 | || ata_disk_is_active() | ||
298 | #endif | ||
299 | )) | ||
300 | return false; | 296 | return false; |
301 | 297 | ||
302 | if (*peak_r > *peak_l) | 298 | if (*peak_r > *peak_l) |
diff --git a/apps/tagtree.c b/apps/tagtree.c index b8fffa9b56..eb9df07113 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c | |||
@@ -1057,7 +1057,7 @@ static int retrieve_entries(struct tree_context *c, struct tagcache_search *tcs, | |||
1057 | /* Show search progress straight away if the disk needs to spin up, | 1057 | /* Show search progress straight away if the disk needs to spin up, |
1058 | otherwise show it after the normal 1/2 second delay */ | 1058 | otherwise show it after the normal 1/2 second delay */ |
1059 | show_search_progress( | 1059 | show_search_progress( |
1060 | #if !defined(HAVE_FLASH_STORAGE) && !defined(SIMULATOR) | 1060 | #if !defined(HAVE_FLASH_STORAGE) |
1061 | ata_disk_is_active() | 1061 | ata_disk_is_active() |
1062 | #else | 1062 | #else |
1063 | true | 1063 | true |
diff --git a/uisimulator/common/stubs.c b/uisimulator/common/stubs.c index 7bf3a4f546..7b630eb25b 100644 --- a/uisimulator/common/stubs.c +++ b/uisimulator/common/stubs.c | |||
@@ -33,6 +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 | 37 | ||
37 | #if CONFIG_CODEC != SWCODEC | 38 | #if CONFIG_CODEC != SWCODEC |
38 | void audio_set_buffer_margin(int seconds) | 39 | void audio_set_buffer_margin(int seconds) |
@@ -108,6 +109,7 @@ void ata_flush(void) | |||
108 | 109 | ||
109 | void ata_spin(void) | 110 | void ata_spin(void) |
110 | { | 111 | { |
112 | ata_spinning = true; | ||
111 | } | 113 | } |
112 | 114 | ||
113 | void ata_sleep(void) | 115 | void ata_sleep(void) |
@@ -115,9 +117,15 @@ void ata_sleep(void) | |||
115 | DEBUGF("ata_sleep()\n"); | 117 | DEBUGF("ata_sleep()\n"); |
116 | } | 118 | } |
117 | 119 | ||
120 | bool ata_disk_is_active(void) | ||
121 | { | ||
122 | return ata_spinning; | ||
123 | } | ||
124 | |||
118 | void ata_spindown(int s) | 125 | void ata_spindown(int s) |
119 | { | 126 | { |
120 | (void)s; | 127 | (void)s; |
128 | ata_spinning = false; | ||
121 | } | 129 | } |
122 | 130 | ||
123 | void rtc_init(void) | 131 | void rtc_init(void) |