Skip to content

Commit a7377a0

Browse files
facchinmcmaglie
authored andcommitted
add numInterfaces field to PUSBCallbacks
1 parent 30b38e5 commit a7377a0

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

hardware/arduino/avr/cores/arduino/PluggableUSB.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ int8_t PUSB_AddFunction(PUSBCallbacks *cb, u8* interface)
9595
}
9696

9797
*interface = lastIf;
98-
lastIf++;
98+
lastIf += cb->numInterfaces;
9999
for ( u8 i = 0; i< cb->numEndpoints; i++) {
100100
_initEndpoints[lastEp] = cb->endpointType[i];
101101
lastEp++;
102102
}
103103
modules_count++;
104-
return lastEp-1;
104+
return lastEp - cb->numEndpoints;
105105
// restart USB layer???
106106
}
107107

hardware/arduino/avr/cores/arduino/PluggableUSB.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ typedef struct
3131
int8_t (*getInterface)(u8* interfaceNum);
3232
int8_t (*getDescriptor)(int8_t t);
3333
int8_t numEndpoints;
34+
int8_t numInterfaces;
3435
u8 endpointType[];
3536
} PUSBCallbacks;
3637

hardware/arduino/avr/cores/arduino/USBCore.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ extern const u16 STRING_LANGUAGE[] PROGMEM;
3333
extern const u8 STRING_PRODUCT[] PROGMEM;
3434
extern const u8 STRING_MANUFACTURER[] PROGMEM;
3535
extern const DeviceDescriptor USB_DeviceDescriptor PROGMEM;
36-
extern const DeviceDescriptor USB_DeviceDescriptorA PROGMEM;
3736
extern const DeviceDescriptor USB_DeviceDescriptorB PROGMEM;
3837

3938
const u16 STRING_LANGUAGE[2] = {
@@ -72,9 +71,6 @@ const u8 STRING_MANUFACTURER[] PROGMEM = USB_MANUFACTURER;
7271
const DeviceDescriptor USB_DeviceDescriptor =
7372
D_DEVICE(0x00,0x00,0x00,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,0,1);
7473

75-
const DeviceDescriptor USB_DeviceDescriptorA =
76-
D_DEVICE(DEVICE_CLASS,0x00,0x00,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,0,1);
77-
7874
const DeviceDescriptor USB_DeviceDescriptorB =
7975
D_DEVICE(0xEF,0x02,0x01,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,0,1);
8076

0 commit comments

Comments
 (0)