Merge pull request #2 from pwarren/master

updated README.md with basic getting started.
Clarify formatting
interactive: rework setting of tx and rx frequencies

The previous implementation had a bug where unless you entered 7
characters, including newlines, it would forever loop. Instead we now
set a timeout of 10 seconds, and use Serial.parseInt which reads an
integer from the serial port until a non-numeric character is found.

While we're here, split out common functionality into helper functions.
This saves us a few hundred bytes of flash. It remains to be seen if
this is a bad trade off for stack consumption at runtime. Execution time
may suffer slightly, but it is not important here.

Signed-off-by: Joel Stanley <joel@jms.id.au>
interactive: move serial input into function

Signed-off-by: Joel Stanley <joel@jms.id.au>
interactive: rework rx_vfo

Use a switch statement instead of a series of if elses, so we don't need
to evaluate every option.

No functional change.

Signed-off-by: Joel Stanley <joel@jms.id.au>
interactive: clean up menu

Code cleanups.

We no longer double-print the status when displaying the status.

Signed-off-by: Joel Stanley <joel@jms.id.au>
interactive: rework calibrate

Use switch statement, and record the offset instead of doing the maths
to reduce code size.

Signed-off-by: Joel Stanley <joel@jms.id.au>
interactive: refactor print_state

Output values are now aligned to make it easier to read.

Signed-off-by: Joel Stanley <joel@jms.id.au>
interactive: Introduce settings structure

This will be used to save the settings to EEPROM.

Signed-off-by: Joel Stanley <joel@jms.id.au>
interactive: Save settings to EEPROM

This adds a menu option for saving and restoring of settings.

A magic number is saved in the first word position; this should be
incremented when making backwards incompatible changes to the settings
structure.

If the magic is incorrect, which includes the first time the firmware is
run, a message will be printed and the settings reset to their default.

Signed-off-by: Joel Stanley <joel@jms.id.au>
interactive: Make libraries buildable

Some confusion with the types and scope is resolved by making the ring
buffer a cpp file (it's all C though), and adding a header for the
definition of pins.

Signed-off-by: Joel Stanley <joel@jms.id.au>
interactive: improve error message when timeout

When the frequency input times out, we print Error. Change it so the
user has a better chance of knowing what's going on.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Add gitignore

Signed-off-by: Joel Stanley <joel@jms.id.au>
interactive: Remove executable bits from TimerOne

Signed-off-by: Joel Stanley <joel@jms.id.au>
interactive: Add channel selection

Using the new menu item 'A' (case insensitive), a user can select from a
list of predefined channels. This eases configuration when setting up
more than one device, with the TX being 1500Hz above the RX.

Note that we listen on the third harmonic of the TX to avoid issues with
the RX stage not be able to tune very well above 27MHz (due to phase
imbalance issues).

Signed-off-by: Joel Stanley <joel@jms.id.au>
interactive: Add version string

Useful when debugging to ensure you're actually flashing the version you
think you are. Displays a string like follows:

 0.1 Dec 7 2014 21:51:34

Signed-off-by: Joel Stanley <joel@jms.id.au>
interactive: Workaround for old versions of GCC

The Arduino distribution for OSX ships an ancient version of GCC (4.3.2
vs 4.8.1 that Ubuntu has). This creates a binary that is 32% larger, and
appears to fail to access data placed in the PROGDATA section correctly.

Add a workaround so users do not hit this bug. When we get to the bottom
of it, we can remove the SRAM version and leave the lookup table in
flash.

Signed-off-by: Joel Stanley <joel@jms.id.au>
interactive: Fix PSK ring buffer bug

I introduced a regression in af4866f49b4 (interactive: Make libraries
buildable) by putting bpsk_varicode into progmem without updating the
accessors.

As progmem access is broken on uin16_t arrays with the Arduino 1.0
toolchain, we will not put the varicode buffer in progmem.

Signed-off-by: Joel Stanley <joel@jms.id.au>
interactive/psk: Add 500 and 1000 modes

We now also print a warning and return false if a user enters a bad
value.

Signed-off-by: Joel Stanley <joel@jms.id.au>
interactive: clean up bpsk code

Signed-off-by: Joel Stanley <joel@jms.id.au>