Skip to content

Commit 8cbebd9

Browse files
committed
add usb setID()
1 parent 47421c9 commit 8cbebd9

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

cores/nRF5/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ int main( void )
7676

7777
#ifdef NRF52840_XXAA
7878
USBDevice.addInterface( (Adafruit_USBD_Interface&) Serial);
79-
USBDevice.begin(USB_VID, USB_PID);
79+
USBDevice.setID(USB_VID, USB_PID);
80+
USBDevice.begin();
8081
usb_init();
8182
#endif
8283

cores/nRF5/usb/Adafruit_TinyUSB_core/Adafruit_USBD_Device.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,14 @@ bool Adafruit_USBD_Device::addInterface(Adafruit_USBD_Interface& itf)
173173
return true;
174174
}
175175

176-
bool Adafruit_USBD_Device::begin(uint16_t vid, uint16_t pid)
176+
void Adafruit_USBD_Device::setID(uint16_t vid, uint16_t pid)
177177
{
178178
_desc_device.idVendor = vid;
179179
_desc_device.idProduct = pid;
180+
}
180181

182+
bool Adafruit_USBD_Device::begin(void)
183+
{
181184
return true;
182185
}
183186

cores/nRF5/usb/Adafruit_TinyUSB_core/Adafruit_USBD_Device.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ class Adafruit_USBD_Device
5151

5252
bool addInterface(Adafruit_USBD_Interface& itf);
5353

54-
bool begin(uint16_t vid, uint16_t pid);
54+
void setID(uint16_t vid, uint16_t pid);
55+
bool begin(void);
5556

5657
bool mounted(void) { return tud_mounted(); }
5758
bool suspended(void) { return tud_suspended(); }

0 commit comments

Comments
 (0)