There are now 3 potential locations to send HID reports:
1. USB
2. The bluefruit easy key
3. Adafruit BLE
Generally speaking, if USB is connected then we should prefer to
send the reports there; it is generally the best channel for this.
The bluefruit module has no feedback about bluetooth connectivity
so the code must speculatively send reports over both USB and bluetooth.
The BLE module has connectivity feedback. In general we want to
prefer to send HID reports over USB while connected there, even
if BLE is connected. Except that it is convenient to force them
over BLE while testing the implementation.
This policy has been extracted out into a where_to_send function
which returns a bitmask of which of the channels should be used.
This implements some helper functions that allow sending key reports
to an SPI based Bluetooth Low Energy module, such as the Adafruit
Feather 32u4 Bluefruit LE.
There is some plumbing required in lufa.c to enable this; that
is in a follow-on commit.
Unlike the arduino functions, these don't take abstract pin numbers,
they take pin labels like `B0`. Also, rather than taking very
generic parameter names, these take slightly more descriptive
enum values.
These improve the clarity of code that would otherwise be inscrutable
bit manipulation in tersely named port register names.
Adopt the macros for saving/restoring the interrupt state
that are provided by the avr gcc environment.
Removing intialization of the timer value; this shaves off
a few bytes because globals are default initialized to zero.