File tree Expand file tree Collapse file tree 2 files changed +12
-13
lines changed
hardware/arduino/avr/libraries/HID Expand file tree Collapse file tree 2 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ HIDDescriptor _hidInterface;
36
36
static HIDDescriptorListNode* rootNode = NULL ;
37
37
static uint16_t sizeof_hidReportDescriptor = 0 ;
38
38
static uint8_t modules_count = 0 ;
39
+ static uint8_t epType[] = { EP_TYPE_INTERRUPT_IN };
40
+
39
41
// ================================================================================
40
42
// ================================================================================
41
43
// Driver
@@ -132,18 +134,14 @@ bool HID_Setup(USBSetup& setup, uint8_t i)
132
134
133
135
HID_::HID_ (void )
134
136
{
135
- static uint8_t endpointType[1 ];
136
- endpointType[0 ] = EP_TYPE_INTERRUPT_IN;
137
-
138
- static PUSBListNode node;
139
- node.setup = &HID_Setup,
140
- node.getInterface = &HID_GetInterface,
141
- node.getDescriptor = &HID_GetDescriptor,
142
- node.numEndpoints = 1 ,
143
- node.numInterfaces = 1 ,
144
- node.endpointType = endpointType,
145
-
146
- HID_ENDPOINT_INT = PluggableUSB.addFunction (&node, &HID_INTERFACE);
137
+ setup = &HID_Setup;
138
+ getInterface = &HID_GetInterface;
139
+ getDescriptor = &HID_GetDescriptor;
140
+ numEndpoints = 1 ;
141
+ numInterfaces = 1 ;
142
+ endpointType = epType;
143
+
144
+ HID_ENDPOINT_INT = PluggableUSB.addFunction (this , &HID_INTERFACE);
147
145
}
148
146
149
147
int HID_::begin (void )
Original file line number Diff line number Diff line change 24
24
25
25
#include < stdint.h>
26
26
#include < Arduino.h>
27
+ #include " PluggableUSB.h"
27
28
28
29
#if defined(USBCON)
29
30
@@ -53,7 +54,7 @@ class HIDDescriptorListNode {
53
54
uint16_t length;
54
55
};
55
56
56
- class HID_
57
+ class HID_ : public PUSBListNode
57
58
{
58
59
public:
59
60
HID_ (void );
You can’t perform that action at this time.
0 commit comments