summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2007-09-30 12:25:06 +0000
committerChristian Gmeiner <christian.gmeiner@gmail.com>2007-09-30 12:25:06 +0000
commit0f5d9f9125e53ae62175469e78151ca4cb0be79a (patch)
treef2b1089fd8fe18eeabc36038cb0f8ae9e39c6429 /apps
parent6386dbe861bc3395dff1bca5b98e8cbe33ddc703 (diff)
downloadrockbox-0f5d9f9125e53ae62175469e78151ca4cb0be79a.tar.gz
rockbox-0f5d9f9125e53ae62175469e78151ca4cb0be79a.tar.bz2
rockbox-0f5d9f9125e53ae62175469e78151ca4cb0be79a.zip
first part of usbstack patches -> show and use selection of usb stack mode only, if
a target supports both modes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14916 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/menus/settings_menu.c7
-rw-r--r--apps/settings.c12
2 files changed, 16 insertions, 3 deletions
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index bbc2505a51..9a4079f1d0 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -516,12 +516,17 @@ int usbdriver_menuitem(void)
return false;
}
+#if USBSTACK_CAPS == (CONTROLLER_DEVICE|CONTROLLER_HOST)
MENUITEM_SETTING(usbstack_mode, &global_settings.usb_stack_mode, NULL);
+#endif
MENUITEM_FUNCTION(usbdriver, 0, ID2P(LANG_USBSTACK_DEVICE_DRIVER),
usbdriver_menuitem, 0, NULL, Icon_NOICON);
MAKE_MENU(usbstack_menu, ID2P(LANG_USBSTACK), 0, Icon_NOICON,
- &usbstack_mode, &usbdriver);
+#if USBSTACK_CAPS == (CONTROLLER_DEVICE|CONTROLLER_HOST)
+ &usbstack_mode,
+#endif
+ &usbdriver);
/* USB STACK MENU */
/***********************************/
#endif
diff --git a/apps/settings.c b/apps/settings.c
index a020c18e1b..cacf3e5854 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -879,11 +879,19 @@ void settings_apply(void)
if (global_settings.colors_file)
read_color_theme_file();
#endif
-
+
#ifdef HAVE_USBSTACK
+
+#if USBSTACK_CAPS == (CONTROLLER_DEVICE|CONTROLLER_HOST)
usb_controller_select(global_settings.usb_stack_mode);
+#elif USBSTACK_CAPS == (CONTROLLER_DEVICE)
+ usb_controller_select(DEVICE);
+#elif USBSTACK_CAPS == (CONTROLLER_HOST)
+ usb_controller_select(HOST);
+#endif
+
usb_device_driver_bind(global_settings.usb_stack_device_driver);
-#endif
+#endif
}