File tree 2 files changed +6
-9
lines changed
2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ int HID_GetDescriptor(int8_t t)
61
61
HIDDescriptorListNode* current = rootNode;
62
62
int total = 0 ;
63
63
while (current != NULL ) {
64
- total += USB_SendControl (TRANSFER_PGM,current->cb -> descriptor ,current-> cb ->length );
64
+ total += USB_SendControl (TRANSFER_PGM,current->data ,current->length );
65
65
current = current->next ;
66
66
}
67
67
return total;
@@ -82,7 +82,7 @@ void HID_::AppendDescriptor(HIDDescriptorListNode *node)
82
82
current->next = node;
83
83
}
84
84
modules_count++;
85
- sizeof_hidReportDescriptor += (uint16_t )node->cb -> length ;
85
+ sizeof_hidReportDescriptor += (uint16_t )node->length ;
86
86
}
87
87
88
88
void HID_::SendReport (u8 id, const void * data, int len)
Original file line number Diff line number Diff line change 44
44
#define HID_REPORT_DESCRIPTOR_TYPE 0x22
45
45
#define HID_PHYSICAL_DESCRIPTOR_TYPE 0x23
46
46
47
- typedef struct __attribute__ ((packed)) {
48
- uint16_t length;
49
- const void * descriptor;
50
- } HID_Descriptor;
51
-
52
47
class HIDDescriptorListNode {
53
48
public:
54
49
HIDDescriptorListNode *next = NULL ;
55
- const HID_Descriptor * cb;
56
- HIDDescriptorListNode (const HID_Descriptor *ncb) {cb = ncb;}
50
+ HIDDescriptorListNode (const void *d, uint16_t l) : data(d), length(l) { }
51
+
52
+ const void * data;
53
+ uint16_t length;
57
54
};
58
55
59
56
class HID_
You can’t perform that action at this time.
0 commit comments