1
0
Fork 0
forked from len0rd/rockbox

FS#10704 - Make a configuration option to disable USB HID

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23322 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Tomer Shalev 2009-10-23 13:29:19 +00:00
parent 6314952ff1
commit 83d24f89df
14 changed files with 137 additions and 57 deletions

View file

@ -218,6 +218,10 @@ static inline bool usb_reboot_button(void)
#endif
#endif /* HAVE_USB_POWER */
#ifdef USB_ENABLE_HID
static bool usb_hid = true;
#endif
static void usb_thread(void)
{
int num_acks_to_expect = 0;
@ -284,7 +288,7 @@ static void usb_thread(void)
#ifdef USB_ENABLE_CHARGING_ONLY
usb_core_enable_driver(USB_DRIVER_HID, false);
#else
usb_core_enable_driver(USB_DRIVER_HID, true);
usb_core_enable_driver(USB_DRIVER_HID, usb_hid);
#endif /* USB_ENABLE_CHARGING_ONLY */
#endif /* USB_ENABLE_HID */
@ -307,7 +311,7 @@ static void usb_thread(void)
usb_core_enable_driver(USB_DRIVER_MASS_STORAGE, true);
#endif
#ifdef USB_ENABLE_HID
usb_core_enable_driver(USB_DRIVER_HID, true);
usb_core_enable_driver(USB_DRIVER_HID, usb_hid);
#endif
#ifdef USB_ENABLE_CHARGING_ONLY
usb_core_enable_driver(USB_DRIVER_CHARGING_ONLY, false);
@ -691,6 +695,14 @@ bool usb_powered(void)
}
#endif
#ifdef USB_ENABLE_HID
void usb_set_hid(bool enable)
{
usb_hid = enable;
usb_core_enable_driver(USB_DRIVER_HID, usb_hid);
}
#endif
#else
#ifdef USB_NONE