diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2009-07-18 12:58:29 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2009-07-18 12:58:29 +0000 |
commit | e409fba7f85e9ddf51e2d6a3342dbca6f667e280 (patch) | |
tree | 63d0e5689658f3a439459611a31462b1cba9fa55 /apps/debug_menu.c | |
parent | 06bb5ea004dacfa81e3c8e192ad2c1f95d2ad18e (diff) | |
download | rockbox-e409fba7f85e9ddf51e2d6a3342dbca6f667e280.tar.gz rockbox-e409fba7f85e9ddf51e2d6a3342dbca6f667e280.zip |
Flyspray: FS#10326
Author: Tomer Shalev
Adds a USB HID sample application, a plugin tha allows to send HID commands while connected in non-storage mode.
This also removes the HID stuff in the debug menu. Testing is now easily doable from the plugin
Also general HID updates
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21953 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r-- | apps/debug_menu.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 648a7e6cae..6a40d4b54a 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -112,13 +112,6 @@ | |||
112 | #include "as3514.h" | 112 | #include "as3514.h" |
113 | #endif | 113 | #endif |
114 | 114 | ||
115 | #ifdef HAVE_USBSTACK | ||
116 | #include "usb_core.h" | ||
117 | #ifdef USB_ENABLE_HID | ||
118 | #include "usbstack/usb_hid.h" | ||
119 | #endif | ||
120 | #endif | ||
121 | |||
122 | /*---------------------------------------------------*/ | 115 | /*---------------------------------------------------*/ |
123 | /* SPECIAL DEBUG STUFF */ | 116 | /* SPECIAL DEBUG STUFF */ |
124 | /*---------------------------------------------------*/ | 117 | /*---------------------------------------------------*/ |
@@ -2635,50 +2628,6 @@ static bool toggle_usb_serial(void) | |||
2635 | } | 2628 | } |
2636 | #endif | 2629 | #endif |
2637 | 2630 | ||
2638 | #ifdef USB_ENABLE_HID | ||
2639 | static bool hid_send_cmd(consumer_usage_page_t cmd, char *msg) | ||
2640 | { | ||
2641 | (void)msg; | ||
2642 | |||
2643 | if (!usb_core_driver_enabled(USB_DRIVER_HID)) { | ||
2644 | splashf(HZ, "Send failed. Driver is disabled"); | ||
2645 | return false; | ||
2646 | } | ||
2647 | |||
2648 | usb_hid_send_consumer_usage(cmd); | ||
2649 | logf("Sent %s command", msg); | ||
2650 | |||
2651 | return false; | ||
2652 | } | ||
2653 | static bool usb_hid_send_play_pause(void) | ||
2654 | { | ||
2655 | return hid_send_cmd(PLAY_PAUSE, "Play/Pause"); | ||
2656 | } | ||
2657 | static bool usb_hid_send_stop(void) | ||
2658 | { | ||
2659 | return hid_send_cmd(STOP, "Stop"); | ||
2660 | } | ||
2661 | static bool usb_hid_send_scan_previous_track(void) | ||
2662 | { | ||
2663 | return hid_send_cmd(SCAN_PREVIOUS_TRACK, "Scan previous track"); | ||
2664 | } | ||
2665 | static bool usb_hid_send_scan_next_track(void) | ||
2666 | { | ||
2667 | return hid_send_cmd(SCAN_NEXT_TRACK, "Scan next track"); | ||
2668 | } | ||
2669 | static bool usb_hid_send_mute(void) | ||
2670 | { | ||
2671 | return hid_send_cmd(MUTE, "Mute"); | ||
2672 | } | ||
2673 | static bool usb_hid_send_volume_decrement(void) | ||
2674 | { | ||
2675 | return hid_send_cmd(VOLUME_DECREMENT, "Vol Down"); | ||
2676 | } | ||
2677 | static bool usb_hid_send_volume_increment(void) | ||
2678 | { | ||
2679 | return hid_send_cmd(VOLUME_INCREMENT, "Vol Up"); | ||
2680 | } | ||
2681 | #endif | ||
2682 | #endif | 2631 | #endif |
2683 | 2632 | ||
2684 | #if CONFIG_USBOTG == USBOTG_ISP1583 | 2633 | #if CONFIG_USBOTG == USBOTG_ISP1583 |
@@ -2819,15 +2768,6 @@ static const struct the_menu_item menuitems[] = { | |||
2819 | #if defined(ROCKBOX_HAS_LOGF) && defined(USB_ENABLE_SERIAL) | 2768 | #if defined(ROCKBOX_HAS_LOGF) && defined(USB_ENABLE_SERIAL) |
2820 | {"USB Serial driver (logf)", toggle_usb_serial }, | 2769 | {"USB Serial driver (logf)", toggle_usb_serial }, |
2821 | #endif | 2770 | #endif |
2822 | #if defined(USB_ENABLE_HID) | ||
2823 | {"USB HID play/pause", usb_hid_send_play_pause }, | ||
2824 | {"USB HID stop", usb_hid_send_stop }, | ||
2825 | {"USB HID prev track", usb_hid_send_scan_previous_track }, | ||
2826 | {"USB HID next track", usb_hid_send_scan_next_track }, | ||
2827 | {"USB HID mute", usb_hid_send_mute }, | ||
2828 | {"USB HID vol down", usb_hid_send_volume_decrement }, | ||
2829 | {"USB HID vol up", usb_hid_send_volume_increment }, | ||
2830 | #endif | ||
2831 | #endif /* HAVE_USBSTACK */ | 2771 | #endif /* HAVE_USBSTACK */ |
2832 | #ifdef CPU_BOOST_LOGGING | 2772 | #ifdef CPU_BOOST_LOGGING |
2833 | {"cpu_boost log",cpu_boost_log}, | 2773 | {"cpu_boost log",cpu_boost_log}, |