diff options
author | Tomer Shalev <shalev.tomer@gmail.com> | 2009-10-23 13:29:19 +0000 |
---|---|---|
committer | Tomer Shalev <shalev.tomer@gmail.com> | 2009-10-23 13:29:19 +0000 |
commit | 83d24f89df743452512357b11f4331c17f5bd6f4 (patch) | |
tree | 90d8f29da59dd91fb7fab748607eec96df30ca04 /firmware | |
parent | 6314952ff1b49372635fd972c887d4e3ba860705 (diff) | |
download | rockbox-83d24f89df743452512357b11f4331c17f5bd6f4.tar.gz rockbox-83d24f89df743452512357b11f4331c17f5bd6f4.zip |
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
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/export/usb.h | 4 | ||||
-rw-r--r-- | firmware/usb.c | 16 |
2 files changed, 18 insertions, 2 deletions
diff --git a/firmware/export/usb.h b/firmware/export/usb.h index 911fa931d9..c380ac518d 100644 --- a/firmware/export/usb.h +++ b/firmware/export/usb.h | |||
@@ -148,4 +148,8 @@ bool firewire_detect(void); | |||
148 | void usb_firewire_connect_event(void); | 148 | void usb_firewire_connect_event(void); |
149 | #endif | 149 | #endif |
150 | 150 | ||
151 | #ifdef USB_ENABLE_HID | ||
152 | void usb_set_hid(bool enable); | ||
153 | #endif | ||
154 | |||
151 | #endif | 155 | #endif |
diff --git a/firmware/usb.c b/firmware/usb.c index 62a335f712..dd0ef9dfe4 100644 --- a/firmware/usb.c +++ b/firmware/usb.c | |||
@@ -218,6 +218,10 @@ static inline bool usb_reboot_button(void) | |||
218 | #endif | 218 | #endif |
219 | #endif /* HAVE_USB_POWER */ | 219 | #endif /* HAVE_USB_POWER */ |
220 | 220 | ||
221 | #ifdef USB_ENABLE_HID | ||
222 | static bool usb_hid = true; | ||
223 | #endif | ||
224 | |||
221 | static void usb_thread(void) | 225 | static void usb_thread(void) |
222 | { | 226 | { |
223 | int num_acks_to_expect = 0; | 227 | int num_acks_to_expect = 0; |
@@ -284,7 +288,7 @@ static void usb_thread(void) | |||
284 | #ifdef USB_ENABLE_CHARGING_ONLY | 288 | #ifdef USB_ENABLE_CHARGING_ONLY |
285 | usb_core_enable_driver(USB_DRIVER_HID, false); | 289 | usb_core_enable_driver(USB_DRIVER_HID, false); |
286 | #else | 290 | #else |
287 | usb_core_enable_driver(USB_DRIVER_HID, true); | 291 | usb_core_enable_driver(USB_DRIVER_HID, usb_hid); |
288 | #endif /* USB_ENABLE_CHARGING_ONLY */ | 292 | #endif /* USB_ENABLE_CHARGING_ONLY */ |
289 | #endif /* USB_ENABLE_HID */ | 293 | #endif /* USB_ENABLE_HID */ |
290 | 294 | ||
@@ -307,7 +311,7 @@ static void usb_thread(void) | |||
307 | usb_core_enable_driver(USB_DRIVER_MASS_STORAGE, true); | 311 | usb_core_enable_driver(USB_DRIVER_MASS_STORAGE, true); |
308 | #endif | 312 | #endif |
309 | #ifdef USB_ENABLE_HID | 313 | #ifdef USB_ENABLE_HID |
310 | usb_core_enable_driver(USB_DRIVER_HID, true); | 314 | usb_core_enable_driver(USB_DRIVER_HID, usb_hid); |
311 | #endif | 315 | #endif |
312 | #ifdef USB_ENABLE_CHARGING_ONLY | 316 | #ifdef USB_ENABLE_CHARGING_ONLY |
313 | usb_core_enable_driver(USB_DRIVER_CHARGING_ONLY, false); | 317 | usb_core_enable_driver(USB_DRIVER_CHARGING_ONLY, false); |
@@ -691,6 +695,14 @@ bool usb_powered(void) | |||
691 | } | 695 | } |
692 | #endif | 696 | #endif |
693 | 697 | ||
698 | #ifdef USB_ENABLE_HID | ||
699 | void usb_set_hid(bool enable) | ||
700 | { | ||
701 | usb_hid = enable; | ||
702 | usb_core_enable_driver(USB_DRIVER_HID, usb_hid); | ||
703 | } | ||
704 | #endif | ||
705 | |||
694 | #else | 706 | #else |
695 | 707 | ||
696 | #ifdef USB_NONE | 708 | #ifdef USB_NONE |