You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
renovate/configure
main
master
f/handleHelp-varargs
wip/refactor-focus
f/clang-format-14
hardware/ploopy
examples/factory-firmware
f/driver/keyboardiohid
tmp/zagdul
jesse/space-cadet
jesse/wip/gd32-win
macros/rearchitecture
wip/rcm-stm32
f/keyboardio-model-100
charshift/configuration
pointing-device
f/samd-testbed
f/automatic-build-nightly
f/driver/keyboardiohid-orig
f/keymap-cache-redesign
tmp/parallel-cli
tmp/arduino-cli-pre-rebase
pr_host_keymap
f/testing-event-queue
testing
epan/testing/main
epan/testing/issue-840
epan/testing/readable
epan/build/justlib
epan/build/cmake
epan/testing/hello-simulator
device/normcore
atreus2/example-layout
v1.99.6
keyboardio-m100-MP-1
keyboardio-m100-DVT-3
keyboardio-m100-DVT-2
v1.99.5
v1.99.4
v1.99.3
v1.99.2
v1.99.1
v1.99.0
v1.98.0
v1.97.0
v1.94.0
v1.93.0
v1.92.0
v1.91.0
driver/bootloader-pre-rebase
shipped-model00-xmas
work-tip
${ noResults }
Jesse Vincent
9e42a149b9
Based on http://forum.freetronics.com/viewtopic.php?f=27&t=679 Adjusting USB bMaxPower value w/ Arduino 1.0.1 Postby adr1an » Wed May 30, 2012 1:42 pm Ok, I've not needed this personally, But fractal pointed out in another thread that when plugging the new 1.0.1 sketches into a device that only allows LowPower devices to be attached, an annoying error message is generated in MaxOSX. By default the sketches are set to negotiate to 500ma for the USB bMaxPower value - this value is part of the USB Standard and sets the maximum amount of current the device should draw. It is part of the spec, but isn't actually reflective of what current the device will draw (an important distinction I guess). In order to write sketches that work without errors on the Host using the LeoStick w/ Arduino 1.0.1, then you can do the following to enable you to adjust the MaxPower values. Its ugly, and I have no idea what I'm doing, but it works, and compiles without error. So this works, but no idea if its the best way.. Edit USBCore.cpp . Around line 47 or so, you'll see CODE: SELECT ALL extern const DeviceDescriptor USB_DeviceDescriptorA PROGMEM; Add the line CODE: SELECT ALL int usbMaxPower = 500; Edit USBCore.h. Edit the D_CONFIG define around line 284 to be: CODE: SELECT ALL { 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED, USB_CONFIG_POWER_MA(usbMaxPower) } By default, it will now negotiate 500ma. However in your sketch, at the top, define CODE: SELECT ALL extern int usbMaxPower Then you can do in setup(), before calling any USB descriptors (i.e, one of the first things) CODE: SELECT ALL usbMaxPower = 100; Voila! Script defineable usbMaxPower values... albeit very klunky and involving hacks to the USBCore.cpp/USBCore.h - which I was trying to avoid. Incidentally - theres a bunch more VID/PID locations I should update I've found, as well as that ugly "Unknown IO" - so will post a fix to that in next day or so. In the meantime - let me know if the above works - curious how transportable the hack is (it seems to have had almost negligible impact on sketch size too! about 6 bytes?) |
11 years ago | |
---|---|---|
.. | ||
keyboardio | Make it possible to drop our power draw. | 11 years ago |