Skip to content

Commit 7e37bb3

Browse files
authored
No fixed value for USB power current.
1 parent f2ac24f commit 7e37bb3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: cores/arduino/USB/USBCore.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@
100100

101101
// bMaxPower in Configuration Descriptor
102102
#define USB_CONFIG_POWER_MA(mA) ((mA)/2)
103+
#ifndef USB_CONFIG_POWER
104+
#define USB_CONFIG_POWER (500)
105+
#endif
103106

104107
#define CDC_V1_10 0x0110
105108
#define CDC_COMMUNICATION_INTERFACE_CLASS 0x02
@@ -258,7 +261,7 @@ _Pragma("pack()")
258261
* idVendor, idProduct, bcdDevice, iManufacturer, iProduct, iSerialNumber, bNumConfigurations */
259262

260263
#define D_CONFIG(_totalLength,_interfaces) \
261-
{ 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED | USB_CONFIG_REMOTE_WAKEUP, USB_CONFIG_POWER_MA(500) }
264+
{ 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED | USB_CONFIG_REMOTE_WAKEUP, USB_CONFIG_POWER_MA(USB_CONFIG_POWER) }
262265
/* Table 9-10. Standard Configuration Descriptor
263266
* bLength, bDescriptorType, wTotalLength, bNumInterfaces, bConfigurationValue, iConfiguration
264267
* bmAttributes, bMaxPower */

0 commit comments

Comments
 (0)