From 5b87efb5a770a4122d61a24f1f3b2b769b0d49b9 Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Mon, 7 Oct 2019 12:35:23 +0100 Subject: [PATCH 1/3] Change the HID Report Descriptor to use the AC Search Usage instead of Voice Command. --- .../src/core/endpoint0/xua_ep0_descriptors.h | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h index e6c56aa9..976daff8 100644 --- a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h +++ b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h @@ -548,6 +548,7 @@ unsigned char devQualDesc_Null[] = #if( 0 < HID_CONTROLS ) +#if 0 unsigned char hidReportDescriptor[] = { 0x05, 0x0c, /* Usage Page (Consumer Device) */ @@ -563,6 +564,26 @@ unsigned char hidReportDescriptor[] = 0x81, 0x01, /* Input (Cnst, Ary, Abs) */ 0xc0 /* End collection */ }; +#else +unsigned char hidReportDescriptor[] = +{ + 0x15, 0x01, /* Logical Minimum (1) */ + 0x25, 0x01, /* Logical Maximum (1) */ + 0x75, 0x01, /* Report Size (1) */ + 0x05, 0x0c, /* Usage Page (Consumer Device) */ + 0x09, 0x01, /* Usage (Consumer Control) */ + 0xa1, 0x01, /* Collection (Application) */ + 0x0a, 0x00, 0x02, /* Usage (Generic GUI Application Controls) */ + 0xa1, 0x02, /* Collection (Logical) */ + 0x0a, 0x21, 0x02, /* Usage (AC Search) */ + 0x95, 0x01, /* Report Count (1) */ + 0x81, 0x40, /* Input (Data, Ary, Abs, Nul) */ + 0x95, 0x07, /* Report Count (7) */ + 0x81, 0x01, /* Input (Cnst, Ary, Abs) */ + 0xc0, /* End collection (Logical) */ + 0xc0 /* End collection (Application) */ +}; +#endif #endif /* Max packet sizes: @@ -2850,7 +2871,7 @@ unsigned char cfgDesc_Audio1[] = 0x00, /* 4 bCountryCode */ 0x01, /* 5 bNumDescriptors */ 0x22, /* 6 bDescriptorType[0] (Report) */ - 0x17, /* 7 wDescriptorLength[0] */ + 0x1E, /* 7 wDescriptorLength[0] */ 0x00, /* 8 wDescriptorLength[0] */ /* HID Endpoint descriptor (IN) */ From 75fea9ed84c5726f9a27b1ffccf5ecc929395a46 Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Tue, 8 Oct 2019 13:44:04 +0100 Subject: [PATCH 2/3] Change the simulated interrupt pulse width from 100 us to 100 ms. --- lib_xua/src/core/user/user_hid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_xua/src/core/user/user_hid.h b/lib_xua/src/core/user/user_hid.h index 687b2445..5688c7c6 100644 --- a/lib_xua/src/core/user/user_hid.h +++ b/lib_xua/src/core/user/user_hid.h @@ -30,7 +30,7 @@ #endif #if( 0 < HID_SIMULATE_INTERRUPTS ) -#define HID_DEASSERT_COUNT 10000 +#define HID_DEASSERT_COUNT 10000000 #define HID_INTERRUPT_COUNT 1000000000 #endif From 1690c4eff6adbbccdacb7819081d1087e3d9e684 Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Tue, 8 Oct 2019 13:45:20 +0100 Subject: [PATCH 3/3] Remove the USB HID Report descriptor with the Voice Command Usage. This commit also contains a small amount of whitespace clean-up. --- .../src/core/endpoint0/xua_ep0_descriptors.h | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h index 976daff8..97685679 100644 --- a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h +++ b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h @@ -546,25 +546,7 @@ unsigned char devQualDesc_Null[] = #define MIXER_LENGTH (0) #endif - #if( 0 < HID_CONTROLS ) -#if 0 -unsigned char hidReportDescriptor[] = -{ - 0x05, 0x0c, /* Usage Page (Consumer Device) */ - 0x09, 0x01, /* Usage (Consumer Control) */ - 0xa1, 0x01, /* Collection (Application) */ - 0x15, 0x00, /* Logical Minimum (0) */ - 0x25, 0x01, /* Logical Maximum (1) */ - 0x09, 0xcf, /* Usage (Voice Command), use 0xcd for (Play/Pause OSC) */ - 0x75, 0x01, /* Report Size (1) */ - 0x95, 0x01, /* Report Count (1) */ - 0x81, 0x06, /* Input (Data, Var, Rel) */ - 0x95, 0x07, /* Report Count (7) */ - 0x81, 0x01, /* Input (Cnst, Ary, Abs) */ - 0xc0 /* End collection */ -}; -#else unsigned char hidReportDescriptor[] = { 0x15, 0x01, /* Logical Minimum (1) */ @@ -575,7 +557,7 @@ unsigned char hidReportDescriptor[] = 0xa1, 0x01, /* Collection (Application) */ 0x0a, 0x00, 0x02, /* Usage (Generic GUI Application Controls) */ 0xa1, 0x02, /* Collection (Logical) */ - 0x0a, 0x21, 0x02, /* Usage (AC Search) */ + 0x0a, 0x21, 0x02, /* Usage (AC Search) */ 0x95, 0x01, /* Report Count (1) */ 0x81, 0x40, /* Input (Data, Ary, Abs, Nul) */ 0x95, 0x07, /* Report Count (7) */ @@ -584,7 +566,6 @@ unsigned char hidReportDescriptor[] = 0xc0 /* End collection (Application) */ }; #endif -#endif /* Max packet sizes: * Samples per channel. e.g (192000+7999/8000) = 24