usb_cdcacm: Remove unused/redundant variables.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Prep usb_descriptors.h for removal.

Just change names and things to fit the libmaple style. Its contents
will move to the top-level <libmaple/usb.h> header next.

This API is still unstable, but we need to expose pieces of it in
order to get the Maple-specific pieces of usb_cdcacm.c into Wirish.

Adjust uses of the API appropriately.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Move contents of usb_descriptors.h to <libmaple/usb.h>.

These form and name of structs etc. is basically determined by the USB
spec and the libmaple style guide, so there's little reason for them
to change, and less reason for them to stay hidden.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
<libmaple/usb.h>: Fix usb_descriptor_string.

uint16 is the wrong type for the bString array.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
usb_cdcacm.h: Add convenience for declaring device descriptor.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
usb_cdcacm.c: Fix up descriptor definitions.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Makefile: move flag settings after build-rules and -templates.

We'll need to mess with the linker flags to add support for ARM
toolchains other than CodeSourcery's. Since the toolchain is
determined in build-rules.mk, decisions that depend on it have to
happen after it's included.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Add support for ARM's GCC ARM embedded toolchain.

Based on patches provided by Hanspeter Portner:

http://forums.leaflabs.com/topic.php?id=1717#post-11812
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
fixup! Add support for ARM's GCC ARM embedded toolchain.

Oops.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Makefile: Don't assume Cortex M3.

Instead, derive -march and -mcpu from the target MCU in
target-config.mk. Also (on STM32F4) add the necessary floating point
flags. The CodeSourcery toolchains don't support these, so we'll need
to prepare alternative toolchains when F4 support is official.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
stm32loader.py: replace obsolete exception catch syntax.

For Python 3 support.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
wirish/ext_interrupts.h: Doxygen

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Make PRIMASK set/clear functions __always_inline.

This is just to ensure that -Os doesn't prevent these from getting
inlined.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
reset.py fixups for OS X 10.8.

As discussed on this forum thread:

http://forums.leaflabs.com/topic.php?id=2451

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Improve Maple device detection in reset.py on Linux

Adds a function to lookup the USB vendor & product id from
the udev info in the sysfs tree. This removes invalid choices
and reduces user queries for the correct ttyACM device.

Signed-off-by: David Kiliani <mail@davidkiliani.de>
reset.py: Not every Unix is Linux.

Move the sysfs tests for Maple out of unix_get_maple_path() and into a
new linux_get_maple_path(). This prevents unnecessary probing for a
nonexistent /sys on e.g. OS X.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Merge branch 'reset-script'

Weed out non-Maple ttyACMs on Linux.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Re-work the constraints on delay_us().  Ask GCC to allocate a register
instead of forcing r0.  Use the same operand as input and output to
remove the move.

Signed-off-by: Michael Hope <michael.hope@linaro.org>
usb_serial.cpp: Neaten up reset signal RX hook.

Move magic bytes from stack to Flash. De-magic-number sizeof magic
byte buffer. Use uintptr_t instead of unsigned int when casting
address of wait_reset().

Based on a patch by Michael Hope.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Revert "Re-work the constraints on delay_us().  Ask GCC to allocate a register"

This reverts commit 715a63dccb3a39d7d0502fb39b900c8302a60a87. It fails
to build using the 2010 CodeSourcery toolchain, which is still the latest
officially supported version.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>