Skip to content

Commit db9fe79

Browse files
committed
Merge remote-tracking branch 'remotes/upstream/master'
2 parents 8a06331 + e6df241 commit db9fe79

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cores/arduino/USB/USBCore.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ extern void USB_SetHandler(void (*pf_isr)(void));
108108

109109
// bMaxPower in Configuration Descriptor
110110
#define USB_CONFIG_POWER_MA(mA) ((mA)/2)
111+
#ifndef USB_CONFIG_POWER
112+
#define USB_CONFIG_POWER (500)
113+
#endif
111114

112115
#define CDC_V1_10 0x0110
113116
#define CDC_COMMUNICATION_INTERFACE_CLASS 0x02
@@ -268,7 +271,7 @@ _Pragma("pack()")
268271
* idVendor, idProduct, bcdDevice, iManufacturer, iProduct, iSerialNumber, bNumConfigurations */
269272

270273
#define D_CONFIG(_totalLength,_interfaces) \
271-
{ 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED | USB_CONFIG_REMOTE_WAKEUP, USB_CONFIG_POWER_MA(500) }
274+
{ 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED | USB_CONFIG_REMOTE_WAKEUP, USB_CONFIG_POWER_MA(USB_CONFIG_POWER) }
272275
/* Table 9-10. Standard Configuration Descriptor
273276
* bLength, bDescriptorType, wTotalLength, bNumInterfaces, bConfigurationValue, iConfiguration
274277
* bmAttributes, bMaxPower */

0 commit comments

Comments
 (0)