aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Watterott <awatterott@users.noreply.github.com>2017-11-13 12:49:06 +0100
committerGitHub <noreply@github.com>2017-11-13 12:49:06 +0100
commit6ad770e86f2758995ed8730505c9ae165ed8ef59 (patch)
tree4ed27c2120e3e2a3ded34c21f02d7ff148e379dd
parent3f63f2975e7183c3254b6794bfcc8f19ca0301c9 (diff)
No fixed value for USB power current.
-rw-r--r--cores/arduino/USBCore.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/cores/arduino/USBCore.h b/cores/arduino/USBCore.h
index 18560b6..5e0c7b3 100644
--- a/cores/arduino/USBCore.h
+++ b/cores/arduino/USBCore.h
@@ -97,6 +97,9 @@
// bMaxPower in Configuration Descriptor
#define USB_CONFIG_POWER_MA(mA) ((mA)/2)
+#ifndef USB_CONFIG_POWER
+ #define USB_CONFIG_POWER (500)
+#endif
// bEndpointAddress in Endpoint Descriptor
#define USB_ENDPOINT_DIRECTION_MASK 0x80
@@ -267,7 +270,7 @@ typedef struct
{ 18, 1, USB_VERSION, _class,_subClass,_proto,_packetSize0,_vid,_pid,_version,_im,_ip,_is,_configs }
#define D_CONFIG(_totalLength,_interfaces) \
- { 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED | USB_CONFIG_REMOTE_WAKEUP, USB_CONFIG_POWER_MA(500) }
+ { 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED | USB_CONFIG_REMOTE_WAKEUP, USB_CONFIG_POWER_MA(USB_CONFIG_POWER) }
#define D_INTERFACE(_n,_numEndpoints,_class,_subClass,_protocol) \
{ 9, 4, _n, 0, _numEndpoints, _class,_subClass, _protocol, 0 }