diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2024-07-07 13:00:28 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2024-07-07 13:18:17 -0400 |
commit | 520875ff00f23f8d986e3d7dd8e2f3937e9dda7e (patch) | |
tree | a62a6eeac1cfa61704e978e9612eccda113997bf | |
parent | dc364e44ef6aeef4082303bc07300d85c5852ba0 (diff) | |
download | rockbox-520875ff00f23f8d986e3d7dd8e2f3937e9dda7e.tar.gz rockbox-520875ff00f23f8d986e3d7dd8e2f3937e9dda7e.zip |
simulator: Fix numerous latent issues
Interactions between HAVE_MULTIVOLUME, HAVE_MULTIDRIVE, and HAVE_HOTSWAP
Change-Id: Ia93792d6a778bf1e5b9bfbc46d982bbba7544651
-rw-r--r-- | uisimulator/common/sim_tasks.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/uisimulator/common/sim_tasks.c b/uisimulator/common/sim_tasks.c index 03e68c111f..839ad828b8 100644 --- a/uisimulator/common/sim_tasks.c +++ b/uisimulator/common/sim_tasks.c | |||
@@ -60,7 +60,7 @@ void sim_thread(void) | |||
60 | struct queue_event ev; | 60 | struct queue_event ev; |
61 | long last_broadcast_tick = current_tick; | 61 | long last_broadcast_tick = current_tick; |
62 | int num_acks_to_expect = 0; | 62 | int num_acks_to_expect = 0; |
63 | 63 | ||
64 | while (1) | 64 | while (1) |
65 | { | 65 | { |
66 | queue_wait_w_tmo(&sim_queue, &ev, 5*HZ); | 66 | queue_wait_w_tmo(&sim_queue, &ev, 5*HZ); |
@@ -69,7 +69,7 @@ void sim_thread(void) | |||
69 | case SYS_TIMEOUT: | 69 | case SYS_TIMEOUT: |
70 | call_storage_idle_notifys(false); | 70 | call_storage_idle_notifys(false); |
71 | break; | 71 | break; |
72 | 72 | ||
73 | case SIM_SCREENDUMP: | 73 | case SIM_SCREENDUMP: |
74 | screen_dump(); | 74 | screen_dump(); |
75 | #ifdef HAVE_REMOTE_LCD | 75 | #ifdef HAVE_REMOTE_LCD |
@@ -134,7 +134,7 @@ void sim_thread(void) | |||
134 | void sim_tasks_init(void) | 134 | void sim_tasks_init(void) |
135 | { | 135 | { |
136 | queue_init(&sim_queue, false); | 136 | queue_init(&sim_queue, false); |
137 | 137 | ||
138 | create_thread(sim_thread, sim_thread_stack, sizeof(sim_thread_stack), 0, | 138 | create_thread(sim_thread, sim_thread_stack, sizeof(sim_thread_stack), 0, |
139 | sim_thread_name IF_PRIO(,PRIORITY_BACKGROUND) IF_COP(,CPU)); | 139 | sim_thread_name IF_PRIO(,PRIORITY_BACKGROUND) IF_COP(,CPU)); |
140 | } | 140 | } |
@@ -220,9 +220,9 @@ void usb_wait_for_disconnect(struct event_queue *q) | |||
220 | } | 220 | } |
221 | } | 221 | } |
222 | 222 | ||
223 | #ifdef HAVE_MULTIDRIVE | ||
224 | static bool is_ext_inserted; | 223 | static bool is_ext_inserted; |
225 | 224 | ||
225 | #ifdef HAVE_MULTIDRIVE | ||
226 | void sim_trigger_external(bool inserted) | 226 | void sim_trigger_external(bool inserted) |
227 | { | 227 | { |
228 | is_ext_inserted = inserted; | 228 | is_ext_inserted = inserted; |
@@ -235,6 +235,7 @@ void sim_trigger_external(bool inserted) | |||
235 | 235 | ||
236 | DEBUGF("Ext %s\n", inserted ? "inserted":"removed"); | 236 | DEBUGF("Ext %s\n", inserted ? "inserted":"removed"); |
237 | } | 237 | } |
238 | #endif | ||
238 | 239 | ||
239 | bool hostfs_present(int drive) | 240 | bool hostfs_present(int drive) |
240 | { | 241 | { |
@@ -246,7 +247,7 @@ bool hostfs_removable(int drive) | |||
246 | return drive > 0; | 247 | return drive > 0; |
247 | } | 248 | } |
248 | 249 | ||
249 | #ifdef HAVE_MULTIVOLUME | 250 | #ifdef HAVE_HOTSWAP |
250 | bool volume_removable(int volume) | 251 | bool volume_removable(int volume) |
251 | { | 252 | { |
252 | /* volume == drive for now */ | 253 | /* volume == drive for now */ |
@@ -258,13 +259,15 @@ bool volume_present(int volume) | |||
258 | /* volume == drive for now */ | 259 | /* volume == drive for now */ |
259 | return hostfs_present(volume); | 260 | return hostfs_present(volume); |
260 | } | 261 | } |
262 | #endif /* HAVE_HOTSWAP */ | ||
261 | 263 | ||
264 | #ifdef HAVE_MULTIDRIVE | ||
262 | int volume_drive(int volume) | 265 | int volume_drive(int volume) |
263 | { | 266 | { |
264 | /* volume == drive for now */ | 267 | /* volume == drive for now */ |
265 | return volume; | 268 | return volume; |
266 | } | 269 | } |
267 | #endif /* HAVE_MULTIVOLUME */ | 270 | #endif |
268 | 271 | ||
269 | #if (CONFIG_STORAGE & STORAGE_MMC) | 272 | #if (CONFIG_STORAGE & STORAGE_MMC) |
270 | bool mmc_touched(void) | 273 | bool mmc_touched(void) |
@@ -296,5 +299,3 @@ int hostfs_driver_type(int drive) | |||
296 | return drive > 0 ? SIMEXT1_TYPE_NUM : STORAGE_HOSTFS_NUM; | 299 | return drive > 0 ? SIMEXT1_TYPE_NUM : STORAGE_HOSTFS_NUM; |
297 | } | 300 | } |
298 | #endif /* CONFIG_STORAGE_MULTI */ | 301 | #endif /* CONFIG_STORAGE_MULTI */ |
299 | |||
300 | #endif /* CONFIG_STORAGE & STORAGE_MMC */ | ||