fw/altos
8 years agoDo radio settings solely by frequency
Keith Packard [Tue, 27 Mar 2012 06:35:35 +0000 (23:35 -0700)]
Do radio settings solely by frequency

Compute the radio setting needed based on the calibration value
provided and the requested frequency.

Signed-off-by: Keith Packard <keithp@keithp.com>
8 years agoaltosui: Use ConcurrentHashMap for maps
Keith Packard [Tue, 27 Mar 2012 05:05:04 +0000 (22:05 -0700)]
altosui: Use ConcurrentHashMap for maps

This data structure is accessed by multiple threads, so it needs to be
re-entrant.

Signed-off-by: Keith Packard <keithp@keithp.com>
8 years agoaltosui: Show time since last packet in flight status window
Keith Packard [Tue, 27 Mar 2012 05:04:13 +0000 (22:04 -0700)]
altosui: Show time since last packet in flight status window

Makes it easy to see when the UI is wedged, and when telemetry data
are being successfully received.

Signed-off-by: Keith Packard <keithp@keithp.com>
8 years agoaltosui: Restructure telemetry classes to be more sane
Keith Packard [Tue, 27 Mar 2012 03:11:34 +0000 (20:11 -0700)]
altosui: Restructure telemetry classes to be more sane

 * Make AltosTelemetryRecord be a class, rather than an interface.

 * Inherit from this for AltosTelemetryRecordLegacy and
   AltosTelemetryRecordRaw.

 * Remove bogus AltosTelemetryRecordGeneral class.

Signed-off-by: Keith Packard <keithp@keithp.com>
8 years agoaltos: Require callsign match in packet code
Keith Packard [Wed, 28 Sep 2011 06:50:43 +0000 (23:50 -0700)]
altos: Require callsign match in packet code

Ignore packets with mismatching callsigns to avoid accidental
connections between devices controlled by different stations.

As a special case, if the device is configured with the default
callsign (N0CALL), then let anyone connect. This allows configuration
of new devices without needing to change the ground station callsign.

Signed-off-by: Keith Packard <keithp@keithp.com>
8 years agodoc: Add companion SPI message protocol doc
Keith Packard [Fri, 13 Jan 2012 18:40:30 +0000 (10:40 -0800)]
doc: Add companion SPI message protocol doc

Signed-off-by: Keith Packard <keithp@keithp.com>
8 years agoupdate turnon_telemetrum to v1.2, add more turnon scripts
Bdale Garbee [Fri, 13 Jan 2012 17:44:23 +0000 (10:44 -0700)]
update turnon_telemetrum to v1.2, add more turnon scripts

8 years agoaltos: Set correct registers for serial0 baud
Keith Packard [Wed, 4 Jan 2012 06:27:59 +0000 (22:27 -0800)]
altos: Set correct registers for serial0 baud

oops. not going to work very well setting serial 1.

Signed-off-by: Keith Packard <keithp@keithp.com>
8 years agoaltos: flush stdout when fifo from arduino serial port is empty
Keith Packard [Wed, 4 Jan 2012 04:46:25 +0000 (20:46 -0800)]
altos: flush stdout when fifo from arduino serial port is empty

This avoids leaving bytes pending inside altos

Signed-off-by: Keith Packard <keithp@keithp.com>
8 years agoBuild teleshield by default
Keith Packard [Wed, 4 Jan 2012 04:42:41 +0000 (20:42 -0800)]
Build teleshield by default

8 years agoaltos: Add support for UART0 in async mode
Keith Packard [Wed, 4 Jan 2012 04:41:15 +0000 (20:41 -0800)]
altos: Add support for UART0 in async mode

And copy bytes from it to stdout.

Signed-off-by: Keith Packard <keithp@keithp.com>
8 years agoaltos: More _asm -> __asm changes
Keith Packard [Fri, 30 Dec 2011 23:42:28 +0000 (15:42 -0800)]
altos: More _asm -> __asm changes

Missed a few last time

Signed-off-by: Keith Packard <keithp@keithp.com>
8 years agoaltos: Clean up for SDCC 3.1 - more keywords
Keith Packard [Fri, 30 Dec 2011 23:38:32 +0000 (15:38 -0800)]
altos: Clean up for SDCC 3.1 - more keywords

_asm -> __asm
sbit -> __sbit
remove variables named 'data'

Signed-off-by: Keith Packard <keithp@keithp.com>
8 years agoaltos: SDCC 3.1 wants __at instead of at
Keith Packard [Fri, 30 Dec 2011 20:27:35 +0000 (12:27 -0800)]
altos: SDCC 3.1 wants __at instead of at

Older SDCC would accept __at, so just replace all occurances unconditionally.

Signed-off-by: Keith Packard <keithp@keithp.com>
8 years agoaltos: Switch teleshield to use radio slave mode
Keith Packard [Tue, 27 Dec 2011 23:47:54 +0000 (15:47 -0800)]
altos: Switch teleshield to use radio slave mode

And bring it up at startup time by default

Signed-off-by: Keith Packard <keithp@keithp.com>
8 years agoaltos: Add teleshield directory and bring-up code
Keith Packard [Tue, 27 Dec 2011 23:37:28 +0000 (15:37 -0800)]
altos: Add teleshield directory and bring-up code

This is cobbled together from various existing bits, but should at
least provide some ability to test a teleshield board.

Signed-off-by: Keith Packard <keithp@keithp.com>
8 years agoaltos: Create TeleMetrum v1.2 directory
Keith Packard [Sun, 18 Dec 2011 01:05:06 +0000 (17:05 -0800)]
altos: Create TeleMetrum v1.2 directory

The hardware is software-compatible with v1.1, but it's nice to have
the right version number in all of the files.

Signed-off-by: Keith Packard <keithp@keithp.com>
8 years agoaltosui: googleearth doesn't accept spaces between coordinates anymore
Keith Packard [Sun, 18 Dec 2011 00:58:04 +0000 (16:58 -0800)]
altosui: googleearth doesn't accept spaces between coordinates anymore

it got pickier for some reason; let's not put spaces in now.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Fix pad orientation for pre-1.1 boards
Keith Packard [Mon, 14 Nov 2011 07:03:22 +0000 (23:03 -0800)]
altos: Fix pad orientation for pre-1.1 boards

They use a different code path for accel as they don't have the
VCC compensation code in place.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Add startup and config (view only) pages to TT
Keith Packard [Sun, 13 Nov 2011 03:19:40 +0000 (19:19 -0800)]
altos: Add startup and config (view only) pages to TT

The config page needs a pile of work before it's useful.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Enable packet master and debug in TT
Keith Packard [Sun, 13 Nov 2011 03:18:53 +0000 (19:18 -0800)]
altos: Enable packet master and debug in TT

The code was already getting linked in, so we might as well use it.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Fix sdcdb settings for telemetrum v1.0
Keith Packard [Sun, 13 Nov 2011 03:18:23 +0000 (19:18 -0800)]
altos: Fix sdcdb settings for telemetrum v1.0

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Trim skytraq NMEA messages. Shrink NMEA header matching code
Keith Packard [Sun, 13 Nov 2011 02:54:14 +0000 (18:54 -0800)]
altos: Trim skytraq NMEA messages. Shrink NMEA header matching code

Tell the skytraq to not bother sending a bunch of the NMEA messages
that we don't parse.

Explicitly look for 'G' follows by 'P' instead of having some general
header matching code.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Allow TT/TBT reports to escape landed state
Keith Packard [Sun, 13 Nov 2011 02:52:02 +0000 (18:52 -0800)]
altos: Allow TT/TBT reports to escape landed state

The TM altitude reporting code kept beeping out state and altitude
forever, which isn't very useful on TBT or TT.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Remove LCD debugging code
Keith Packard [Sun, 13 Nov 2011 02:51:31 +0000 (18:51 -0800)]
altos: Remove LCD debugging code

This isn't needed anymore.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltosui: Add ao_lcd_cursor_on/off
Keith Packard [Sun, 13 Nov 2011 02:51:03 +0000 (18:51 -0800)]
altosui: Add ao_lcd_cursor_on/off

This shows or hides a blinking cursor on the LCD.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Add configurable set of channels for TT
Keith Packard [Sun, 13 Nov 2011 02:49:17 +0000 (18:49 -0800)]
altos: Add configurable set of channels for TT

This adds the channel list for TT, which will be configured by
AltosUI.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Export 'ao_cmd_is_white' for use by other code
Keith Packard [Sun, 13 Nov 2011 02:48:07 +0000 (18:48 -0800)]
altos: Export 'ao_cmd_is_white' for use by other code

This function tests the current input character.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Set default flight log max to 127k on TM v0.1
Keith Packard [Sun, 13 Nov 2011 02:47:08 +0000 (18:47 -0800)]
altos: Set default flight log max to 127k on TM v0.1

The flash part on v0.1 boards is only 128kB.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Handle internal and external telem monitoring requests
Keith Packard [Sun, 13 Nov 2011 02:44:36 +0000 (18:44 -0800)]
altos: Handle internal and external telem monitoring requests

Record separate internal vs external monitoring state, allowing
both to happen at the same time, and when either is turned off, the
other keeps working.

This also adds disable/enable so that other radio users can
temporarily take over the radio; monitoring will resume when the other
radio user is finished.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Check pdata+xdata memory usage during build
Keith Packard [Sun, 13 Nov 2011 02:37:53 +0000 (18:37 -0800)]
altos: Check pdata+xdata memory usage during build

The sdcc linker doesn't check the sum of pdata+xdata memory usage, it
only ensures that xdata itself is small enough. This doesn't keep
xdata below the end of usable ram on the cc1111 though (0xfe000).

Fix up the check-stack program to also make sure all of xdata fits in
available memory.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Set SPI fill value each time it is used.
Keith Packard [Sun, 13 Nov 2011 02:32:49 +0000 (18:32 -0800)]
altos: Set SPI fill value each time it is used.

This ensures that the final MOSI pin value will be high after a
receive is finished.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Initialize DMA config address at boot time
Keith Packard [Sun, 13 Nov 2011 02:31:46 +0000 (18:31 -0800)]
altos: Initialize DMA config address at boot time

Instead of resetting these each time a transfer is started, just set
them once at boot time.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: debounce buttons
Keith Packard [Sun, 13 Nov 2011 02:30:56 +0000 (18:30 -0800)]
altos: debounce buttons

Provide API to clear out any button events that happen during startup,
and then discard button events 'too close' together.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Build TeleTerra v0.2 by default
Keith Packard [Sun, 13 Nov 2011 02:29:38 +0000 (18:29 -0800)]
altos: Build TeleTerra v0.2 by default

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltosui: Deal with serial port exceptions a bit better
Keith Packard [Sun, 13 Nov 2011 02:10:18 +0000 (18:10 -0800)]
altosui: Deal with serial port exceptions a bit better

This catches a few exceptions and tries to make sure the serial port
is closed afterwards.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Make ao_xmem funcs require __xdata void * instead of casting
Keith Packard [Sat, 12 Nov 2011 06:30:17 +0000 (22:30 -0800)]
altos: Make ao_xmem funcs require __xdata void * instead of casting

Having an explicit cast in the ao_xmem wrapper macros caused the
compiler to generate garbage values for pdata addresses, making the
upper byte 0x00 instead of the required 0xf0. Removing the
casts from the ao_xmem macros exposed this problem, so a new
PDATA_TO_XDATA macros was added, along with a CODE_TO_XDATA macro
which serve to cast pointers, with suitable address modifications, so
that things work again.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltosui: Make UI Look&Feel configurable
Keith Packard [Sat, 12 Nov 2011 06:24:22 +0000 (22:24 -0800)]
altosui: Make UI Look&Feel configurable

Saves the preferred style and uses that for all current and new windows.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Shrink Skytraq NMEA parsing - common nmea_finish code
Keith Packard [Sat, 12 Nov 2011 01:18:08 +0000 (17:18 -0800)]
altos: Shrink Skytraq NMEA parsing - common nmea_finish code

This shares the checksum testing across all three lines, saving
another 103 bytes.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: shrink Skytraq NMEA parsing more
Keith Packard [Sat, 12 Nov 2011 01:11:39 +0000 (17:11 -0800)]
altos: shrink Skytraq NMEA parsing more

This cuts another 78 bytes

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Shrink code size of Skytraq NMEA parser
Keith Packard [Sat, 12 Nov 2011 00:54:18 +0000 (16:54 -0800)]
altos: Shrink code size of Skytraq NMEA parser

Just mess around with the code to make it smaller. These patches save
173 bytes.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: A bunch of missing .gitignore files (mostly)
Keith Packard [Thu, 27 Oct 2011 08:01:11 +0000 (01:01 -0700)]
altos: A bunch of missing .gitignore files (mostly)

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Add i2c driver for avr chip
Keith Packard [Thu, 27 Oct 2011 07:57:45 +0000 (00:57 -0700)]
altos: Add i2c driver for avr chip

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltosui: Only update GPS data when new GPS information arrives
Keith Packard [Thu, 27 Oct 2011 07:49:23 +0000 (00:49 -0700)]
altosui: Only update GPS data when new GPS information arrives

Track which telemetry packets are actually producing new GPS
information and only update the GPS average position and count of
stable GPS reports with new GPS info, instead of on every telemetry packet.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Fix distance/bearing computations. Deal with large values
Keith Packard [Thu, 27 Oct 2011 07:35:35 +0000 (00:35 -0700)]
altos: Fix distance/bearing computations. Deal with large values

Lots of little math errors dealing with large distances; easily tested
as the GPS currently reports lat 24 lon 121, which is a long ways from
Portland.

Now reports distances in km when large, otherwise in m.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Bring up basic TeleTerra v0.2 UI multiarch
Keith Packard [Thu, 27 Oct 2011 05:49:11 +0000 (22:49 -0700)]
altos: Bring up basic TeleTerra v0.2 UI

Lots of fun stuff here -- multiple panes of information.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Flip button IRQ initialization around
Keith Packard [Sun, 23 Oct 2011 22:24:02 +0000 (15:24 -0700)]
altos: Flip button IRQ initialization around

This matches what the docs suggest

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Fix battery voltage computation.
Keith Packard [Sun, 23 Oct 2011 22:20:50 +0000 (15:20 -0700)]
altos: Fix battery voltage computation.

Full scale is 4.95V, not 3.333V.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Add battery voltage sampling driver
Keith Packard [Sun, 23 Oct 2011 21:51:32 +0000 (14:51 -0700)]
altos: Add battery voltage sampling driver

For devices without a full ADC compliment, this just samples the
battery pin and converts to mV.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Add button driver and sample user
Keith Packard [Sun, 23 Oct 2011 21:08:59 +0000 (14:08 -0700)]
altos: Add button driver and sample user

Hook up the teleterra buttons and have them beep

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agosrc/teleterra-v0.2: Initialize more hardware
Keith Packard [Sun, 23 Oct 2011 19:55:35 +0000 (12:55 -0700)]
src/teleterra-v0.2: Initialize more hardware

Initialize the flash storage and flight state reporting beeper.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos/teleterra_0_2: Initialize LCD driver
Keith Packard [Sun, 23 Oct 2011 19:51:05 +0000 (12:51 -0700)]
altos/teleterra_0_2: Initialize LCD driver

Initialize the LCD for testing.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agosrc/teleballoon-v1.1: Use Tm style initial state stuff
Keith Packard [Fri, 21 Oct 2011 21:58:26 +0000 (14:58 -0700)]
src/teleballoon-v1.1: Use Tm style initial state stuff

Come up in pad mode unless someone talks to us while in idle mode.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Add teleballoon-v1.1 directory
Keith Packard [Fri, 21 Oct 2011 18:30:43 +0000 (11:30 -0700)]
altos: Add teleballoon-v1.1 directory

This is an alternate firmware load for telemetrum v1.1.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Add LEGACY_MONITOR defines to more programs
Keith Packard [Sun, 16 Oct 2011 05:54:40 +0000 (22:54 -0700)]
altos: Add LEGACY_MONITOR defines to more programs

Make all monitoring programs define whether they want all of the old
telemetry formats too.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoao-bringup: Make it build with source restructuring
Keith Packard [Sun, 16 Oct 2011 05:54:02 +0000 (22:54 -0700)]
ao-bringup: Make it build with source restructuring

Source code all moved around, need to find the header files in new directories.x

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Add TeleTerra v0.2 product
Keith Packard [Wed, 12 Oct 2011 05:30:53 +0000 (23:30 -0600)]
altos: Add TeleTerra v0.2 product

This includes most of the necessary drivers.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: oops -- forgot to add the cc1111 string code
Keith Packard [Wed, 12 Oct 2011 05:29:24 +0000 (23:29 -0600)]
altos: oops -- forgot to add the cc1111 string code

This is required for all cc1111 builds now; it provides xdata string
functions.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Split out arch-specific bits of LCD driver
Keith Packard [Wed, 12 Oct 2011 05:28:02 +0000 (23:28 -0600)]
altos: Split out arch-specific bits of LCD driver

The arch-specific section just puts a single nibble to the device.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoBump to 1.0.9.3 1.0.9.3
Keith Packard [Wed, 12 Oct 2011 02:58:04 +0000 (20:58 -0600)]
Bump to 1.0.9.3

TeleScience and TelePyro now work.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos/telescience: Add more header dependencies
Keith Packard [Wed, 12 Oct 2011 00:48:55 +0000 (18:48 -0600)]
altos/telescience: Add more header dependencies

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos/avr: telescience doesn't have room for the flash write code
Keith Packard [Wed, 12 Oct 2011 00:48:11 +0000 (18:48 -0600)]
altos/avr: telescience doesn't have room for the flash write code

This is useful for debugging the SPI and flash drivers, but not
necessary in production code.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos/avr: Must leave space for init stack in ram
Keith Packard [Wed, 12 Oct 2011 00:45:51 +0000 (18:45 -0600)]
altos/avr: Must leave space for init stack in ram

The stack used during system initialization lives at the top of RAM,
so leave some space for that.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos/avr: Shrink default stack size to use less ram
Keith Packard [Wed, 12 Oct 2011 00:44:48 +0000 (18:44 -0600)]
altos/avr: Shrink default stack size to use less ram

Not that we have any way of knowing how much stack we're using, but at
least this seems to work.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Allow ao_science_slave to not log data
Keith Packard [Wed, 12 Oct 2011 00:13:00 +0000 (18:13 -0600)]
altos: Allow ao_science_slave to not log data

This is mostly for debugging with flash writes disabled.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Make HAS_STORAGE_DEBUG define consistent
Keith Packard [Wed, 12 Oct 2011 00:11:56 +0000 (18:11 -0600)]
altos: Make HAS_STORAGE_DEBUG define consistent

This allows products to include the 'w' command for testing flash
writing as needed.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos/avr: Clear SPI receive buffer before clocking new data in
Keith Packard [Wed, 12 Oct 2011 00:10:45 +0000 (18:10 -0600)]
altos/avr: Clear SPI receive buffer before clocking new data in

I don't know why this is necessary, but the receive buffer gets
'extra' data added somehow.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos/avr: Pull-up on the SPI slave select pin
Keith Packard [Tue, 11 Oct 2011 23:44:40 +0000 (17:44 -0600)]
altos/avr: Pull-up on the SPI slave select pin

This makes the board work even when disconnected from TeleMetrum.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos/avr: Register stdio handler when using serial for stdin
Keith Packard [Tue, 11 Oct 2011 23:44:02 +0000 (17:44 -0600)]
altos/avr: Register stdio handler when using serial for stdin

This code was left in a bit of a mess; just clean it up.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos/avr: telescience does not have a serial port
Keith Packard [Tue, 11 Oct 2011 23:42:24 +0000 (17:42 -0600)]
altos/avr: telescience does not have a serial port

The USART is used for SPI to talk to the flash part.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos/avr: Make ao_arch_critical argument be a statement
Keith Packard [Tue, 11 Oct 2011 23:39:35 +0000 (17:39 -0600)]
altos/avr: Make ao_arch_critical argument be a statement

Wrap the argument to ao_arch_critical in do { } while (0); to make
sure it gets correctly checked as a statement.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos/avr: Print newline after dumping ADC values
Keith Packard [Tue, 11 Oct 2011 23:39:06 +0000 (17:39 -0600)]
altos/avr: Print newline after dumping ADC values

Cleans up the formating a bit.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos/avr: SPI mutex is now held by the caller, not the SPI driver
Keith Packard [Tue, 11 Oct 2011 22:03:04 +0000 (16:03 -0600)]
altos/avr: SPI mutex is now held by the caller, not the SPI driver

SPI transactions generally require a read followed by a write, with
the chip select held the whole time. As a result, the SPI bus must be
held across multiple transactions. To make this reliable, the caller
must hold the SPI mutex, instead of the underlying SPI driver.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltosui: Deal with missing state transitions in FlightStats window 1.0.9.2
Keith Packard [Sun, 9 Oct 2011 17:09:25 +0000 (11:09 -0600)]
altosui: Deal with missing state transitions in FlightStats window

Any missing start/end times are pinned to the end of the flight.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltosui: Deal with telem data that goes backwards in time
Keith Packard [Sun, 9 Oct 2011 16:55:04 +0000 (10:55 -0600)]
altosui: Deal with telem data that goes backwards in time

The new telemetry stuff can send packets with older timestamps, so
sort telem packets read from disk to create an in-order record of the flight.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Respond to telemetry rate changes immediately
Keith Packard [Sun, 9 Oct 2011 16:21:56 +0000 (10:21 -0600)]
altos: Respond to telemetry rate changes immediately

Instead of waiting for the previous telemetry interval to expire,
immediately switch to the new telemetry rate. This will provide
more telemetry data early in the boost.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Improve TM v1.0 apogee estimate
Keith Packard [Sun, 9 Oct 2011 04:19:52 +0000 (22:19 -0600)]
altos: Improve TM v1.0 apogee estimate

v1.0 boards have noisy accelerometer data caused by interactions
between RF transmission and the accelerometer measurements; this noise
generates a negative bias in the accelerometer readings. The net
effect is that the estimated speed is lower than the actual speed,
causing early an apogee estimate.

By increasing the sigma value for accelerometer data, the kalman
filter 'trusts' the acceleration data less, putting more weight on the
barometer data. This causes the estimated time of apogee to be closer
to the correct value.

This reduces the response to changes in acceleration.

This new value is applied solely to TeleMetrum v1.0 boards. v1.1
boards correct for this error, and hence can use the correct sigma
value for the accelerometer.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoBump to 1.0.9.2
Keith Packard [Sun, 9 Oct 2011 03:31:34 +0000 (21:31 -0600)]
Bump to 1.0.9.2

(1.1 RC 2). Flown at Oktoberfest 2011 on 10/09/2011 (we hope)

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltosui: Remove igniter voltages from chart.
Keith Packard [Sat, 8 Oct 2011 22:07:57 +0000 (16:07 -0600)]
altosui: Remove igniter voltages from chart.

These are just annoying; when we add the ability to turn stuff on/off
on the fly, we can add them to the list of available items.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Ignore ejection bumps when doing boost re-detect
Keith Packard [Sat, 8 Oct 2011 17:51:05 +0000 (11:51 -0600)]
altos: Ignore ejection bumps when doing boost re-detect

An ejection charge looks an awful lot like an extra (really small)
motor burn. Ignore them by averaging the acceleration during
fast/coast using a /64 exponential decay filter.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoao-telem: Add new program to convert telem data to ascii
Keith Packard [Sat, 8 Oct 2011 17:50:24 +0000 (11:50 -0600)]
ao-telem: Add new program to convert telem data to ascii

This reads telem files and displays them in ascii form. It's not done,
and it's not documented, but it's a start.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltosui: Allow for multiple instances of each state in the graph
Keith Packard [Sat, 8 Oct 2011 17:46:38 +0000 (11:46 -0600)]
altosui: Allow for multiple instances of each state in the graph

With the new boost re-detect code, we can get multiple instances of
boost/fast/coast, so make sure each are displayed in the graph.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltosui: Max acceleration across boost instead of all ascent
Keith Packard [Sat, 8 Oct 2011 17:43:37 +0000 (11:43 -0600)]
altosui: Max acceleration across boost instead of all ascent

This ignores ejection bumps, making the max acceleration far more useful.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Write xdata versions of memory functions 1.0.9.1
Keith Packard [Fri, 7 Oct 2011 15:53:09 +0000 (09:53 -0600)]
altos: Write xdata versions of memory functions

These are significantly smaller than the general pointer versions from
libc on the cc1111.

Signed-off-by: Keith Packard <keithp@keithp.com>
Conflicts:

src/Makefile.proto
src/cc1111/ao_adc.c
src/cc1111/ao_packet_master.c
src/core/ao.h

Fix up the new makefiles

9 years agoMerge remote-tracking branch 'origin/simple-quiet' into multiarch
Keith Packard [Fri, 7 Oct 2011 14:41:56 +0000 (08:41 -0600)]
Merge remote-tracking branch 'origin/simple-quiet' into multiarch

Conflicts:
configure.ac

fix version number

9 years agoMerge remote-tracking branch 'uniarch/master' into multiarch
Keith Packard [Fri, 7 Oct 2011 14:40:14 +0000 (08:40 -0600)]
Merge remote-tracking branch 'uniarch/master' into multiarch

Conflicts:
src/core/ao_cmd.c

Use ao_arch_reboot after waiting for a second

9 years agoaltos: TM: Don't turn on packet slave mode until idle/invalid state
Keith Packard [Wed, 28 Sep 2011 04:06:54 +0000 (21:06 -0700)]
altos: TM: Don't turn on packet slave mode until idle/invalid state

Leave the packet link disabled until we've checked the
accelerometer. That way, we cannot accidentally get to idle mode when
the rocket is on the rail.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Delay reboot by a second to avoid re-entering idle mode
Keith Packard [Mon, 26 Sep 2011 18:50:28 +0000 (11:50 -0700)]
altos: Delay reboot by a second to avoid re-entering idle mode

TM and Tm go into idle mode if they receive a packet after boot
time. When tebooting the device over the packet link, the packet
master would be (rapidly) polling the device for additional data and
so the device would invariably receive a packet during bootup and go
into idle mode again.

Delay the reboot by a second to give the controller time to disable
the master end of the packet link.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoMerge remote-tracking branch 'origin/master' into multiarch
Keith Packard [Fri, 7 Oct 2011 14:34:59 +0000 (08:34 -0600)]
Merge remote-tracking branch 'origin/master' into multiarch

Conflicts:
configure.ac

Fix version number and location of ao.h header

9 years agoadd run-time dependency on libjfreechart-java
Bdale Garbee [Tue, 27 Sep 2011 06:59:08 +0000 (00:59 -0600)]
add run-time dependency on libjfreechart-java

9 years agoMerge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Bdale Garbee [Sat, 24 Sep 2011 21:34:59 +0000 (15:34 -0600)]
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos

9 years agoinclude 1.0.1 release notes in docs, closes: #642705
Bdale Garbee [Tue, 30 Aug 2011 22:59:53 +0000 (16:59 -0600)]
include 1.0.1 release notes in docs, closes: #642705

9 years agoaltos: Debug code for telepyro doesn't fit in telescience
Keith Packard [Fri, 23 Sep 2011 17:24:33 +0000 (10:24 -0700)]
altos: Debug code for telepyro doesn't fit in telescience

Just too many strings.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoDump test conversion of ADC0
Keith Packard [Thu, 22 Sep 2011 06:21:04 +0000 (23:21 -0700)]
Dump test conversion of ADC0

9 years agoDump ADC registers
Keith Packard [Thu, 22 Sep 2011 05:54:56 +0000 (22:54 -0700)]
Dump ADC registers

9 years agoaltos: Fix make-kalman to run under dash
Keith Packard [Thu, 22 Sep 2011 01:13:55 +0000 (18:13 -0700)]
altos: Fix make-kalman to run under dash

Dash can't deal with >&, so use the old-school > file 2>&1

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agofix bashism that prevents building with /bin/sh->/bin/dash
Bdale Garbee [Wed, 21 Sep 2011 22:42:52 +0000 (16:42 -0600)]
fix bashism that prevents building with /bin/sh->/bin/dash

9 years agoadd missing sense_h entry in TelePyro table
Bdale Garbee [Wed, 21 Sep 2011 22:42:22 +0000 (16:42 -0600)]
add missing sense_h entry in TelePyro table

9 years agoaltos: missing ao_log_single.c
Keith Packard [Wed, 21 Sep 2011 21:24:30 +0000 (14:24 -0700)]
altos: missing ao_log_single.c

Neglected to add this file.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 years agoaltos: Add TelePyro v0.1 support
Keith Packard [Wed, 21 Sep 2011 18:30:43 +0000 (11:30 -0700)]
altos: Add TelePyro v0.1 support

Signed-off-by: Keith Packard <keithp@keithp.com>