Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c0b0803

Browse files
Merge pull request #4 from awatterott/master
No fixed value for USB power current.
2 parents 319be02 + 6ad770e commit c0b0803

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎cores/arduino/USBCore.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@
9797

9898
// bMaxPower in Configuration Descriptor
9999
#define USB_CONFIG_POWER_MA(mA) ((mA)/2)
100+
#ifndef USB_CONFIG_POWER
101+
#define USB_CONFIG_POWER (500)
102+
#endif
100103

101104
// bEndpointAddress in Endpoint Descriptor
102105
#define USB_ENDPOINT_DIRECTION_MASK 0x80
@@ -267,7 +270,7 @@ typedef struct
267270
{ 18, 1, USB_VERSION, _class,_subClass,_proto,_packetSize0,_vid,_pid,_version,_im,_ip,_is,_configs }
268271

269272
#define D_CONFIG(_totalLength,_interfaces) \
270-
{ 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED | USB_CONFIG_REMOTE_WAKEUP, USB_CONFIG_POWER_MA(500) }
273+
{ 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED | USB_CONFIG_REMOTE_WAKEUP, USB_CONFIG_POWER_MA(USB_CONFIG_POWER) }
271274

272275
#define D_INTERFACE(_n,_numEndpoints,_class,_subClass,_protocol) \
273276
{ 9, 4, _n, 0, _numEndpoints, _class,_subClass, _protocol, 0 }

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /