From 488ace3d138ef1eb183ab53b9b24fa9ea3eeb301 Mon Sep 17 00:00:00 2001 From: NicoHood Date: Fri, 7 Aug 2015 19:42:04 +0200 Subject: Fixed HID Reports >255 bytes --- libraries/HID/HID.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libraries/HID/HID.cpp') diff --git a/libraries/HID/HID.cpp b/libraries/HID/HID.cpp index 0d2133e..04b5731 100644 --- a/libraries/HID/HID.cpp +++ b/libraries/HID/HID.cpp @@ -43,7 +43,7 @@ static u8 HID_INTERFACE; HIDDescriptor _hidInterface; static HIDDescriptorListNode* rootNode = NULL; -static uint8_t sizeof_hidReportDescriptor = 0; +static uint16_t sizeof_hidReportDescriptor = 0; static uint8_t modules_count = 0; //================================================================================ //================================================================================ @@ -91,7 +91,7 @@ void HID_::AppendDescriptor(HIDDescriptorListNode *node) current->next = node; } modules_count++; - sizeof_hidReportDescriptor += node->cb->length; + sizeof_hidReportDescriptor += (uint16_t)node->cb->length; } void HID_::SendReport(u8 id, const void* data, int len) -- cgit v1.2.3-18-g5258 From d1fe40060e3c9b1f060e86221aeabf7f70a66316 Mon Sep 17 00:00:00 2001 From: NicoHood Date: Fri, 7 Aug 2015 19:45:18 +0200 Subject: Added 16 byte endpoint support --- libraries/HID/HID.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libraries/HID/HID.cpp') diff --git a/libraries/HID/HID.cpp b/libraries/HID/HID.cpp index 04b5731..c629eb9 100644 --- a/libraries/HID/HID.cpp +++ b/libraries/HID/HID.cpp @@ -59,7 +59,7 @@ int HID_GetInterface(u8* interfaceNum) { D_INTERFACE(HID_INTERFACE,1,3,0,0), D_HIDREPORT(sizeof_hidReportDescriptor), - D_ENDPOINT(USB_ENDPOINT_IN (HID_ENDPOINT_INT),USB_ENDPOINT_TYPE_INTERRUPT,0x40,0x01) + D_ENDPOINT(USB_ENDPOINT_IN (HID_ENDPOINT_INT),USB_ENDPOINT_TYPE_INTERRUPT,USB_EP_SIZE,0x01) }; return USB_SendControl(0,&_hidInterface,sizeof(_hidInterface)); } -- cgit v1.2.3-18-g5258