simulator: Fix numerous latent issues

Interactions between HAVE_MULTIVOLUME, HAVE_MULTIDRIVE, and HAVE_HOTSWAP

Change-Id: Ia93792d6a778bf1e5b9bfbc46d982bbba7544651
This commit is contained in:
Solomon Peachy 2024-07-07 13:00:28 -04:00
parent dc364e44ef
commit 520875ff00

View file

@ -220,9 +220,9 @@ void usb_wait_for_disconnect(struct event_queue *q)
}
}
#ifdef HAVE_MULTIDRIVE
static bool is_ext_inserted;
#ifdef HAVE_MULTIDRIVE
void sim_trigger_external(bool inserted)
{
is_ext_inserted = inserted;
@ -235,6 +235,7 @@ void sim_trigger_external(bool inserted)
DEBUGF("Ext %s\n", inserted ? "inserted":"removed");
}
#endif
bool hostfs_present(int drive)
{
@ -246,7 +247,7 @@ bool hostfs_removable(int drive)
return drive > 0;
}
#ifdef HAVE_MULTIVOLUME
#ifdef HAVE_HOTSWAP
bool volume_removable(int volume)
{
/* volume == drive for now */
@ -258,13 +259,15 @@ bool volume_present(int volume)
/* volume == drive for now */
return hostfs_present(volume);
}
#endif /* HAVE_HOTSWAP */
#ifdef HAVE_MULTIDRIVE
int volume_drive(int volume)
{
/* volume == drive for now */
return volume;
}
#endif /* HAVE_MULTIVOLUME */
#endif
#if (CONFIG_STORAGE & STORAGE_MMC)
bool mmc_touched(void)
@ -296,5 +299,3 @@ int hostfs_driver_type(int drive)
return drive > 0 ? SIMEXT1_TYPE_NUM : STORAGE_HOSTFS_NUM;
}
#endif /* CONFIG_STORAGE_MULTI */
#endif /* CONFIG_STORAGE & STORAGE_MMC */