Fixed HID Reports >255 bytes

This commit is contained in:
NicoHood 2015-08-07 19:42:04 +02:00
parent 77cc20f119
commit 488ace3d13
2 changed files with 5 additions and 5 deletions

View File

@ -43,7 +43,7 @@ static u8 HID_INTERFACE;
HIDDescriptor _hidInterface; HIDDescriptor _hidInterface;
static HIDDescriptorListNode* rootNode = NULL; static HIDDescriptorListNode* rootNode = NULL;
static uint8_t sizeof_hidReportDescriptor = 0; static uint16_t sizeof_hidReportDescriptor = 0;
static uint8_t modules_count = 0; static uint8_t modules_count = 0;
//================================================================================ //================================================================================
//================================================================================ //================================================================================
@ -91,7 +91,7 @@ void HID_::AppendDescriptor(HIDDescriptorListNode *node)
current->next = node; current->next = node;
} }
modules_count++; modules_count++;
sizeof_hidReportDescriptor += node->cb->length; sizeof_hidReportDescriptor += (uint16_t)node->cb->length;
} }
void HID_::SendReport(u8 id, const void* data, int len) void HID_::SendReport(u8 id, const void* data, int len)

View File

@ -45,7 +45,7 @@
#define HID_PHYSICAL_DESCRIPTOR_TYPE 0x23 #define HID_PHYSICAL_DESCRIPTOR_TYPE 0x23
typedef struct __attribute__((packed)) { typedef struct __attribute__((packed)) {
u8 length; uint16_t length;
const void* descriptor; const void* descriptor;
} HID_Descriptor; } HID_Descriptor;
@ -88,10 +88,10 @@ typedef struct
#define HID_TX HID_ENDPOINT_INT #define HID_TX HID_ENDPOINT_INT
#define D_HIDREPORT(_descriptorLength) \ #define D_HIDREPORT(_descriptorLength) \
{ 9, 0x21, 0x1, 0x1, 0, 1, 0x22, _descriptorLength, 0 } { 9, 0x21, 0x1, 0x1, 0, 1, 0x22, _descriptorLength & 0xFF, _descriptorLength >> 8 }
#define WEAK __attribute__ ((weak)) #define WEAK __attribute__ ((weak))
#endif #endif
#endif #endif