@@ -62,7 +62,6 @@ USBClass USB;
62
62
uint8_t _picotool_itf_num;
63
63
#endif
64
64
65
-
66
65
int usb_hid_poll_interval __attribute__ ((weak)) = 10;
67
66
68
67
uint8_t USBClass::registerEndpointIn () {
@@ -91,7 +90,7 @@ void USBClass::unregisterEndpointOut(int ep) {
91
90
_endpointOut |= (1 << (ep - 0x80 ));
92
91
}
93
92
94
- uint8_t USBClass::addEntry (Entry **head, int interfaces, void (*cb)(int itf, uint8_t *dst, int len, void *param), const void *param, size_t len, int ordering, uint32_t vidMask ) {
93
+ uint8_t USBClass::addEntry (Entry **head, int interfaces, void (*cb)(int itf, uint8_t *dst, int len, void *param), const void *param, size_t len, int ordering, uint32_t pidMask ) {
95
94
static uint8_t id = 1 ;
96
95
97
96
Entry *n = (Entry *)malloc (sizeof (Entry));
@@ -101,7 +100,7 @@ uint8_t USBClass::addEntry(Entry **head, int interfaces, void (*cb)(int itf, uin
101
100
n->interfaces = interfaces;
102
101
n->order = ordering;
103
102
n->localid = id++;
104
- n->mask = vidMask ;
103
+ n->mask = pidMask ;
105
104
n->next = nullptr ;
106
105
107
106
// Go down list until we hit the end or an entry with ordering >= our level
@@ -163,17 +162,17 @@ uint8_t USBClass::findInterfaceID(unsigned int localid) {
163
162
}
164
163
165
164
// Called by a HID device to register a report. Returns the *local* ID which must be mapped to the HID report ID
166
- uint8_t USBClass::registerHIDDevice (const uint8_t *descriptor, size_t len, int ordering, uint32_t vidMask ) {
167
- return addEntry (&_hids, 0 , nullptr , (const void *)descriptor, len, ordering, vidMask );
165
+ uint8_t USBClass::registerHIDDevice (const uint8_t *descriptor, size_t len, int ordering, uint32_t pidMask ) {
166
+ return addEntry (&_hids, 0 , nullptr , (const void *)descriptor, len, ordering, pidMask );
168
167
}
169
168
170
169
void USBClass::unregisterHIDDevice (unsigned int localid) {
171
170
removeEntry (&_hids, localid);
172
171
}
173
172
174
173
// Called by an object at global init time to add a new interface (non-HID, like CDC or Picotool)
175
- uint8_t USBClass::registerInterface (int interfaces, void (*cb)(int itf, uint8_t *dst, int len, void *), void *param, size_t len, int ordering, uint32_t vidMask ) {
176
- return addEntry (&_interfaces, interfaces, cb, param, len, ordering, vidMask );
174
+ uint8_t USBClass::registerInterface (int interfaces, void (*cb)(int itf, uint8_t *dst, int len, void *), void *param, size_t len, int ordering, uint32_t pidMask ) {
175
+ return addEntry (&_interfaces, interfaces, cb, param, len, ordering, pidMask );
177
176
}
178
177
179
178
void USBClass::unregisterInterface (unsigned int localid) {
0 commit comments