Add support for autodetecting the mac's alternate platforms dir
slightly simplify our autogenerated code as we work toward being able to build
in the arduino ide
Get our Makefile to actually use our alternate Arduino core
Add a first pass at an arduino core for our keyboard firmware based
on the head of Arduino 1.0 git.

Unfortunately, this is what we need to do to add more HID profiles
make the indents match the arduino indents
Wakeup for USB host. First clean version
Added first part of SUSPEND / WAKEUP handling; store SUSPI in _usbSuspendState
initialize _usbSuspendState in USBDevice_::attach
Added support to press power/sleep/hibernate (and some more) buttons via System Controls. Implemented in Keyboard_::systemControl().
Added Keyboard.pressRaw(), releaseRaw() and writeRaw() to make it possible to send other keys than just ASCII
Added error messages when USB chip is unknown or clock rate is not supported
removed pressRaw + releaseRaw because this functionality is already contained in the fix for issue #1391 and the code was redundant
Added error message when method of USB PLL initialization is unknown.
added Mouse.moveAbs() as a new feature for absolute mouse positioning as requested in issue #1417. all parameters have the range of -32768 to 32767 and must be scaled to screen pixels some examples: x=0, y=0 is the middle of the screen x=-32768, y=-32768 is the top left corner x=32767, y=-32768 is the top right corner x=32767, y=32767 is the bottom right corner x=-32768, y=32767 is the bottom left corner
non-working first pass at systemcontrol and consumercontrol
absolute mouse breaks things
When building with a makefile, use the alternate keyboardio core locally
Stop unintentional fallthrough to mouse keys
add the consumer and system control keys we currently support
Make it possible to drop our power draw.

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?)