small changes to hotplugging support
This commit is contained in:
parent
248e8ad1ca
commit
866970fb1c
|
@ -120,15 +120,16 @@ static void gx_devthread(void *a)
|
|||
|
||||
slock_lock(gx_device_mutex);
|
||||
|
||||
for (i = 0; i < GX_DEVICE_END; i++)
|
||||
{
|
||||
if (gx_devices[i].mounted &&
|
||||
!gx_devices[i].interface->isInserted())
|
||||
{
|
||||
gx_devices[i].mounted = false;
|
||||
char n[8];
|
||||
snprintf(n, sizeof(n), "%s:", gx_devices[i].name);
|
||||
fatUnmount(n);
|
||||
for (i = 0; i < GX_DEVICE_END; i++) {
|
||||
if (gx_devices[i].mounted) {
|
||||
if (!gx_devices[i].interface->isInserted()) {
|
||||
gx_devices[i].mounted = false;
|
||||
char n[8];
|
||||
snprintf(n, sizeof(n), "%s:", gx_devices[i].name);
|
||||
fatUnmount(n);
|
||||
}
|
||||
} else if (gx_devices[i].interface->startup() && gx_devices[i].interface->isInserted()) {
|
||||
gx_devices[i].mounted = fatMountSimple(gx_devices[i].name, gx_devices[i].interface);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,15 +140,6 @@ static void gx_devthread(void *a)
|
|||
slock_unlock(gx_device_cond_mutex);
|
||||
}
|
||||
}
|
||||
|
||||
static int gx_get_device_from_path(const char *path)
|
||||
{
|
||||
if (strstr(path, "sd:") == path)
|
||||
return GX_DEVICE_SD;
|
||||
if (strstr(path, "usb:") == path)
|
||||
return GX_DEVICE_USB;
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LOGGER
|
||||
|
|
|
@ -1936,17 +1936,6 @@ static int menu_displaylist_parse_generic(menu_displaylist_info_t *info, bool *n
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(GEKKO) && defined(HW_RVL)
|
||||
slock_lock(gx_device_mutex);
|
||||
device = gx_get_device_from_path(info->path);
|
||||
|
||||
if (device != -1 && !gx_devices[device].mounted &&
|
||||
gx_devices[device].interface->isInserted())
|
||||
fatMountSimple(gx_devices[device].name, gx_devices[device].interface);
|
||||
|
||||
slock_unlock(gx_device_mutex);
|
||||
#endif
|
||||
|
||||
path_is_compressed = path_is_compressed_file(info->path);
|
||||
push_dir = (info->setting
|
||||
&& info->setting->browser_selection_type == ST_DIR);
|
||||
|
|
Loading…
Reference in New Issue