Changing Arduino Leonardo USB Configuration Power

I am trying to have my Leonard HID Joystick report its maximum current requirement as 100ma. I have looked at previous posts/forums that suggest editing the USBCore.h file as a solution.

My attempts to change the values in the header file do not seem to have any effect. The device continues to report as a 500ma device.

Any suggestions would be greatly appreciated.

Cheers,

Adrian

This change does it for me.

diff --git a/hardware/arduino/avr/cores/arduino/USBCore.h b/hardware/arduino/avr/cores/arduino/USBCore.h
index 0c63c2b..4176d87 100644
--- a/hardware/arduino/avr/cores/arduino/USBCore.h
+++ b/hardware/arduino/avr/cores/arduino/USBCore.h
@@ -270,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(USB_CONFIG_POWER) }
+	{ 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED | USB_CONFIG_REMOTE_WAKEUP, USB_CONFIG_POWER_MA(100) }
 
 #define D_INTERFACE(_n,_numEndpoints,_class,_subClass,_protocol) \
 	{ 9, 4, _n, 0, _numEndpoints, _class,_subClass, _protocol, 0 }

Thanks. That confirms I was on the right track.

I had made the changes in 1.8.19 but it still reported as a 500ma device.

This morning, I downloaded the new IDE, made the change to USBCore.h and it worked!

Cheers,

Adrian

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.