up_n_down: turn off completely when locked

The flashlight does not turn off (using DPIN_PWR) after being locked.
This is because the new mode is set to MODE_OFF, but the code to change
mode to MODE_OFF is not executed.
Added arduino bootloader and hexbright board info

Conflicts:
	hardware/hexbright/boards.txt
bootloader code cleanup

Removed conditional code which is never compiled in.
bootloader: blink the GREEN LED on startup

Hexbright has a green LED that can be used to signal the boot loader,
but on a different pin than Arduino, so we must make a special case
for it.
bootloader: get rid of global variables and functions

Since nothing links against these symbols, make them static or even
automatic.
bootloader: optimize for size

Size is at premium here, not speed...
bootloader: clean up error handling

Interestingly, this saves about 30 bytes of code...
bootloader: provide CPP macros for response begin/end

Hard-coded constants don't look right. Preprocessor constants are also
more resilient to typos.
bootloader: Implement putstr()

Although, this enlarges the data section, the savings in the amount of
code are huge, hopefully making enough room for monitor on most
platforms.
bootloader: Enable MONITOR mode

The bootloader now fits into 1024 words even with the MONITOR mode
enabled.
bootloader: Remove an unused variable

This variable is never used (i.e. it only emits a compiler warning).
bootloader: Fix progmem attributes

The PROGMEM attribute determines where data is stored, but it has no
influence on how it is accessed, so the welcome message is in fact
copied to RAM at program startup.

Since we lose anyway, we may just stop confusing people with a PGM_P
variable and use plain old (inefficient) const pointers.

BTW this is really only about startup speed. There is always more than
enough RAM for all the static data...
bootloader: use putstr() in monitor

Reduce code size by converting the strings in MONITOR mode to use
putstr().
bootloader: Add echogetch() utility function

Convert getch() + putch() pairs to use a common function which gets
a character and echoes it back.

Reduces code size.
bootloader: move strings to PROGMEM

This is extremely ugly due to avr gcc limitations (PROGMEM pointer types
are only big enough for <=64k). At least I was able to:

1. make use of the most efficient "lpm" variant for the target platform,
2. get bits>16 in a clean way (ie. it will work with >128k models)
3. avoid code bloat
bootloader: inline functions to manipulate the LED

The LED behaviour seems inconsistent. On Arduino boards, the LED is
connected between "pin 13" (PB5) and GND, so it is on when the pin is
high.

OTOH the MONITOR mode assumes inverted logic (a comment says "turn on
LED", followed by clearing the corresponding bit in LED_PORT), so there
might be some boards with the LED connected between "pin 13" and VCC
(but that would leave the LED on when leaving the boot loader?).

Either way, let's leave no doubts about the intention by using an
intuitive function name instead of direct bit manipulation.
bootloader: support for inverted LEDs

Add a compile-time parameter for boards that have inverted logic on the
pin 13 LED (if there are any).
bootloader: cleanup getNch()

This function should call getch() repeatedly to get consistent
behaviour on timeouts. As a bonus, we get rid of the ugly #if
conditionals in this function.
bootloader: use echogetch() for uart loopback

I can see no reason to open-code echogetch() here...
bootloader: turn off timeout in MONITOR mode

The timeout in monitor mode is annoying when manually connecting to the
device. However, the 'u' command (UART loopback) has no other way to
quit, so re-enable the timeout just for this one command.