File tree 2 files changed +7
-11
lines changed
2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ int HID_GetDescriptor(int8_t t)
68
68
HIDDescriptorListNode* current = rootNode;
69
69
int total = 0 ;
70
70
while (current != NULL ) {
71
- total += USBD_SendControl (0 ,current->cb -> descriptor ,current-> cb ->length );
71
+ total += USBD_SendControl (0 ,current->data ,current->length );
72
72
current = current->next ;
73
73
}
74
74
return total;
@@ -89,7 +89,7 @@ void HID_::AppendDescriptor(HIDDescriptorListNode *node)
89
89
current->next = node;
90
90
}
91
91
modules_count++;
92
- sizeof_hidReportDescriptor += node->cb -> length ;
92
+ sizeof_hidReportDescriptor += node->length ;
93
93
}
94
94
95
95
void HID_::SendReport (uint8_t id, const void * data, int len)
@@ -165,4 +165,4 @@ HID_::HID_(void)
165
165
int HID_::begin (void )
166
166
{
167
167
return 0 ;
168
- }
168
+ }
Original file line number Diff line number Diff line change 42
42
#define HID_REPORT_DESCRIPTOR_TYPE 0x22
43
43
#define HID_PHYSICAL_DESCRIPTOR_TYPE 0x23
44
44
45
- typedef struct __attribute__ ((packed)) {
46
- uint8_t length;
47
- const void * descriptor;
48
- } HID_Descriptor;
49
-
50
45
class HIDDescriptorListNode {
51
46
public:
52
47
HIDDescriptorListNode *next = NULL ;
53
- const HID_Descriptor * cb;
54
- HIDDescriptorListNode (const HID_Descriptor *ncb) {cb = ncb;}
48
+ HIDDescriptorListNode (const void *d, uint16_t l) : data(d), length(l) { }
49
+ uint8_t length;
50
+ const void * data;
55
51
};
56
52
57
53
class HID_
@@ -90,4 +86,4 @@ typedef struct
90
86
91
87
#define WEAK __attribute__ ((weak))
92
88
93
- #endif
89
+ #endif
You can’t perform that action at this time.
0 commit comments