fw/altos
17 months agoaltos: Build megadongle when possible 1.1.9.2
Keith Packard [Fri, 2 Nov 2012 00:52:22 +0000 (17:52 -0700)]
altos: Build megadongle when possible

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

17 months agoaltos/megadongle: Add megadongle product
Keith Packard [Thu, 1 Nov 2012 17:51:41 +0000 (10:51 -0700)]
altos/megadongle: Add megadongle product

Looks a lot like teledongle from a feature perspective.

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

17 months agoaltos: Remove legacy telemetry from ao_monitor when not needed
Keith Packard [Thu, 1 Nov 2012 17:50:03 +0000 (10:50 -0700)]
altos: Remove legacy telemetry from ao_monitor when not needed

For products not supporting LEGACY_MONITOR, remove the (undefined)
structs from the ao_monitor union.

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

17 months agoaltos: Remove 'volatile' from ao_rssi.c globals
Keith Packard [Thu, 1 Nov 2012 17:49:17 +0000 (10:49 -0700)]
altos: Remove 'volatile' from ao_rssi.c globals

No need for this, the variables aren't changed at interrupt time.

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

17 months agoaltos/stm: Support LEDs on multiple ports
Keith Packard [Thu, 1 Nov 2012 17:48:08 +0000 (10:48 -0700)]
altos/stm: Support LEDs on multiple ports

Split out the bits in a fairly simplistic fashion so that we support
no more than 16 LEDs still.

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

17 months agoaltos/attiny: Remove debugging code which frobs PB1
Keith Packard [Wed, 31 Oct 2012 02:56:51 +0000 (19:56 -0700)]
altos/attiny: Remove debugging code which frobs PB1

This was clearly stuck there to debug something; not a good idea...

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

17 months agoaltos/micropeak: Run MS5607 at max resolution for micropeak
Keith Packard [Wed, 31 Oct 2012 02:44:45 +0000 (19:44 -0700)]
altos/micropeak: Run MS5607 at max resolution for micropeak

We've got lots of time, so get the highest resolution baro data available.

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

17 months agoaltos/micropeak: Clock micropeak at 250kHz to save power
Keith Packard [Wed, 31 Oct 2012 02:41:08 +0000 (19:41 -0700)]
altos/micropeak: Clock micropeak at 250kHz to save power

This reduces average current consumption from 2mA to .4mA. This
makes the battery last longer, but also gets the current under
something that the typical CR1025 battery can support. Would be nice
to reduce current even further; cheap CR1025 batteries still seem to
fade a bit at this current level.

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

17 months agoaltos/attiny: Don't initialize the CS pin in the general SPI setup
Keith Packard [Wed, 31 Oct 2012 02:39:55 +0000 (19:39 -0700)]
altos/attiny: Don't initialize the CS pin in the general SPI setup

Let the CS pin be configured by the driver, which can set the correct
value before enabling the output.

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

17 months agoaltos/micropeak: Set boost detect to 10m. Add 30s boost delay.
Keith Packard [Tue, 30 Oct 2012 00:07:05 +0000 (17:07 -0700)]
altos/micropeak: Set boost detect to 10m. Add 30s boost delay.

Wait for 30 seconds before even starting look for boost. This provides
an opportunity to close up the airframe, potentially causing pressure
gradients seen by the baro sensor.

Also, require a 10m vertical motion before triggering boost. This
should limit accidental boost detect while capturing any actual flights.

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

17 months agodoc: Add micropeak manual
Keith Packard [Mon, 29 Oct 2012 18:49:23 +0000 (11:49 -0700)]
doc: Add micropeak manual

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

17 months agoaltos: Build micropeak when avr-gcc is available
Keith Packard [Mon, 29 Oct 2012 18:48:58 +0000 (11:48 -0700)]
altos: Build micropeak when avr-gcc is available

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

17 months agoaltos/micropeak: Switch to MS5607 sensor. Require 4m for boost. Elide dead code
Keith Packard [Mon, 29 Oct 2012 18:47:17 +0000 (11:47 -0700)]
altos/micropeak: Switch to MS5607 sensor. Require 4m for boost. Elide dead code

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

17 months agoaltos/attiny: Update to new interrupt macros
Keith Packard [Mon, 29 Oct 2012 18:43:02 +0000 (11:43 -0700)]
altos/attiny: Update to new interrupt macros

Add ao_arch_block/release_interrupts macros to attiny architecture

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

17 months agoMerge remote-tracking branch 'mjb/altosdroid'
Keith Packard [Fri, 26 Oct 2012 21:08:32 +0000 (14:08 -0700)]
Merge remote-tracking branch 'mjb/altosdroid'

17 months agoaltos: Provide ao_task_alarm_tick to reduce per-tick cost
Keith Packard [Thu, 25 Oct 2012 20:42:10 +0000 (13:42 -0700)]
altos: Provide ao_task_alarm_tick to reduce per-tick cost

Cache the next wakeup time and check that before jumping to the task
code.

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

17 months agoaltos: Leave interrupts disabled while checking for task to run
Keith Packard [Thu, 25 Oct 2012 20:40:54 +0000 (13:40 -0700)]
altos: Leave interrupts disabled while checking for task to run

Otherwise, we run the risk of an interrupt waking a task after we've
decided to idle the CPU.

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

17 months agoaltos: Clean up stm arch macros a bit.
Keith Packard [Thu, 25 Oct 2012 20:38:13 +0000 (13:38 -0700)]
altos: Clean up stm arch macros a bit.

Turn a bunch of the macros into inline functions.
Clean up the reboot method to use the stm_scb structure.

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

17 months agoaltos: Clean up cc1111 architecture macros a bit, removing cli/sei
Keith Packard [Thu, 25 Oct 2012 20:35:47 +0000 (13:35 -0700)]
altos: Clean up cc1111 architecture macros a bit, removing cli/sei

Just reformatting changes, aside from the removal of cli/sei

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

17 months agoaltos: Wrap ao_container_of value in parens
Keith Packard [Thu, 25 Oct 2012 20:33:43 +0000 (13:33 -0700)]
altos: Wrap ao_container_of value in parens

Keeps the cast from being separated from the value when used
in expressions.

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

17 months agoaltos: Switch drivers to ao_arch_block/release_interrupts
Keith Packard [Thu, 25 Oct 2012 18:25:42 +0000 (11:25 -0700)]
altos: Switch drivers to ao_arch_block/release_interrupts

Stop using cli/sei, which are avr-specific

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

17 months agoaltosdroid: more restrictive commit no. matching
Mike Beattie [Thu, 25 Oct 2012 07:39:20 +0000 (20:39 +1300)]
altosdroid: more restrictive commit no. matching

Signed-off-by: Mike Beattie <mike@ethernal.org>

17 months agoaltosdroid: more reliable branch detection
Mike Beattie [Thu, 25 Oct 2012 07:31:59 +0000 (20:31 +1300)]
altosdroid: more reliable branch detection

Signed-off-by: Mike Beattie <mike@ethernal.org>

17 months agoBump version to 1.1.9.2
Keith Packard [Thu, 25 Oct 2012 07:12:57 +0000 (00:12 -0700)]
Bump version to 1.1.9.2

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

17 months agoMerge remote-tracking branch 'mjb/altosdroid'
Keith Packard [Thu, 25 Oct 2012 07:09:01 +0000 (00:09 -0700)]
Merge remote-tracking branch 'mjb/altosdroid'

17 months agoaltos/megametrum: Depend on Makefile contents for build
Keith Packard [Thu, 25 Oct 2012 07:04:27 +0000 (00:04 -0700)]
altos/megametrum: Depend on Makefile contents for build

This ensures that everything is rebuilt when the Makefile changes

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

17 months agoaltos: Add task queues.
Keith Packard [Thu, 25 Oct 2012 06:50:55 +0000 (23:50 -0700)]
altos: Add task queues.

This replaces the array-based scheduler with a queue-based one
instead. It should have the same basic scheduling semantics, but it
walks shorter lists for each operation, making it much more efficient
when the system has a lot of tasks.

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

17 months agoaltos: Add stack-guard code. Uses STM MPU to trap stack overflow.
Keith Packard [Thu, 25 Oct 2012 05:46:55 +0000 (22:46 -0700)]
altos: Add stack-guard code. Uses STM MPU to trap stack overflow.

This marks the lowest portion of the stack as inaccessible to the CPU,
causing the processor to fault when it reaches it. The fault then
generates a panic message so that the user can know what happened.

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

17 months agoaltos: Replace __critical usage with ao_arch_critical as needed
Keith Packard [Thu, 25 Oct 2012 05:35:32 +0000 (22:35 -0700)]
altos: Replace __critical usage with ao_arch_critical as needed

sdcc offers __critical as a machine-independent way to block
interrupts, but as gcc doesn't, we need to use a compiler-independent
construct instead. ao_arch_critical has been around since the AVR
port, but some old __critical usages remained.

This fixes a bunch of random hangs when communicating with MM over USB
or the radio as the various stdio loops were running without
interrupts blocked between the test and the sleep.

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

17 months agoaltos: profiling on STM32L
Keith Packard [Wed, 24 Oct 2012 05:17:49 +0000 (22:17 -0700)]
altos: profiling on STM32L

Add sample-based profiling, using a 1kHz timer

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

17 months agoaltos: Add ao_arch_block/release_interrupts to avr and cc1111
Keith Packard [Thu, 25 Oct 2012 06:21:38 +0000 (23:21 -0700)]
altos: Add ao_arch_block/release_interrupts to avr and cc1111

Stop using cli/sei for AVR, add replacement to __critical for cc1111

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

17 months agoaltos: Force beep timer regs reload when enabling beeper
Keith Packard [Thu, 25 Oct 2012 06:55:00 +0000 (23:55 -0700)]
altos: Force beep timer regs reload when enabling beeper

Without this, there can be a long delay between asking for the beeper
and having it actually start sounding.

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

17 months agoaltos: When slave mode first starts, accept any packet
Keith Packard [Thu, 25 Oct 2012 06:52:49 +0000 (23:52 -0700)]
altos: When slave mode first starts, accept any packet

This eliminates the packet sequence matching for the first packet,
allowing outstanding send data to arrive from the master instead of
ignoring packets with data until they match the seqno

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

17 months agoaltosui: Allow AltosConfig to abort before serial line starts
Keith Packard [Thu, 25 Oct 2012 06:55:45 +0000 (23:55 -0700)]
altosui: Allow AltosConfig to abort before serial line starts

Check to see if the serial line is active before trying to close it.

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

17 months agoaltosdroid: Add version information to UI
Mike Beattie [Wed, 24 Oct 2012 07:54:18 +0000 (20:54 +1300)]
altosdroid: Add version information to UI

Signed-off-by: Mike Beattie <mike@ethernal.org>

17 months agoaltosdroid: Add branch to BuildInfo
Mike Beattie [Wed, 24 Oct 2012 07:52:09 +0000 (20:52 +1300)]
altosdroid: Add branch to BuildInfo

Signed-off-by: Mike Beattie <mike@ethernal.org>

17 months agoMerge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Bdale Garbee [Tue, 23 Oct 2012 15:38:36 +0000 (09:38 -0600)]
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos

17 months agoremove local copy of launch-sites.txt and reference to old web location
Bdale Garbee [Tue, 23 Oct 2012 15:33:17 +0000 (09:33 -0600)]
remove local copy of launch-sites.txt and reference to old web location

17 months agoaltosdroid: match only the current version tag
Mike Beattie [Tue, 23 Oct 2012 06:22:52 +0000 (19:22 +1300)]
altosdroid: match only the current version tag

Don't match non version tags - and always return the long format of
git describe, rather than just the tag (when the tag is on the current
commit).

Split the commit number/hash more reliably by removing the version tag
from the result first.

Signed-off-by: Mike Beattie <mike@ethernal.org>

17 months agoMerge remote-tracking branch 'mjb/altosdroid'
Keith Packard [Tue, 23 Oct 2012 05:39:31 +0000 (22:39 -0700)]
Merge remote-tracking branch 'mjb/altosdroid'

17 months agoaltosui: Allow any non-basestation to be configured
Keith Packard [Tue, 23 Oct 2012 05:38:46 +0000 (22:38 -0700)]
altosui: Allow any non-basestation to be configured

TelePyro has some configuration bits.

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

17 months agoaltos: make check-avr-mem utility executable
Keith Packard [Tue, 23 Oct 2012 04:39:12 +0000 (21:39 -0700)]
altos: make check-avr-mem utility executable

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

17 months agoaltos: Allow pyro flight state config to be set
Keith Packard [Tue, 23 Oct 2012 04:38:18 +0000 (21:38 -0700)]
altos: Allow pyro flight state config to be set

Without these lines, flight state compares can't be shown or set.

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

17 months agoaltos: Let AVR products override the stack size. Set telepyro to 104
Keith Packard [Tue, 23 Oct 2012 04:37:25 +0000 (21:37 -0700)]
altos: Let AVR products override the stack size. Set telepyro to 104

Otherwise, telepyro doesn't have enough ram...

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

17 months agoaltoslib: capitalize 'Invalid' state name appropriately
Keith Packard [Tue, 23 Oct 2012 04:36:12 +0000 (21:36 -0700)]
altoslib: capitalize 'Invalid' state name appropriately

It shouldn't ever appear, but it seemed wrong to have it not match the
rest of the strings.

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

17 months agoaltosui/altoslib: Add support for configuring pyro channels
Keith Packard [Tue, 23 Oct 2012 04:35:06 +0000 (21:35 -0700)]
altosui/altoslib: Add support for configuring pyro channels

This provides a UI on devices which have pyro channels other than
main/apogee.

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

17 months agoaltos: Add state comparisons to pyro channel conditions
Keith Packard [Mon, 22 Oct 2012 15:52:08 +0000 (08:52 -0700)]
altos: Add state comparisons to pyro channel conditions

Let pyro channels block waiting for flight state changes. This
allows for pyro channels to be synchronized with the main iginiter
channels.

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

17 months agoaltosdroid: add autogenerated BuildInfo.java
Mike Beattie [Sun, 21 Oct 2012 22:55:07 +0000 (11:55 +1300)]
altosdroid: add autogenerated BuildInfo.java

* Generated by shell script that parses git describe
* Makefile rule to call script on every run
* also includes eclipse hooks to call shell script on build

Signed-off-by: Mike Beattie <mike@ethernal.org>

17 months agoaltosdroid: AltosState now has speed and max_speed funcs
Keith Packard [Mon, 22 Oct 2012 03:57:21 +0000 (20:57 -0700)]
altosdroid: AltosState now has speed and max_speed funcs

These pull out the appropriate baro/accel speed values and may use
some fancier values in future.

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

17 months agoaltoslib: Add AltosRecordNone.java
Keith Packard [Mon, 22 Oct 2012 02:51:02 +0000 (19:51 -0700)]
altoslib: Add AltosRecordNone.java

oops. forgot a file.

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

17 months agoaltos/test: Use MMA655X in ao_flight_test_mm. Add run-mm to plot mm data
Keith Packard [Mon, 22 Oct 2012 00:26:16 +0000 (17:26 -0700)]
altos/test: Use MMA655X in ao_flight_test_mm. Add run-mm to plot mm data

Pull MMA655X data out of eeprom file when available. Switch build to
using MMA655x by default.

Clone run-one to plot a single mm flight

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

17 months agoaltosui: Handle .mega files in Landed tab 'Graph Flight' button
Keith Packard [Mon, 22 Oct 2012 00:00:08 +0000 (17:00 -0700)]
altosui: Handle .mega files in Landed tab 'Graph Flight' button

Need to check for .mega files here too.

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

17 months agoaltos: Document mega log packet types
Keith Packard [Sun, 21 Oct 2012 23:55:00 +0000 (16:55 -0700)]
altos: Document mega log packet types

Just add comments to ao_log.h so it's easy to remember which labels go
with each record.

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

17 months agoaltoslib: Parse GPS .mega file entries for reply/graphing
Keith Packard [Sun, 21 Oct 2012 23:53:23 +0000 (16:53 -0700)]
altoslib: Parse GPS .mega file entries for reply/graphing

The .mega file parsing had a pile of leftovers from when it was cloned
from the .eeprom file parsing code. Replace all of that with the right
parsing bits so that GPS data will be presented correctly.

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

17 months agoaltoslib: Move computed state from AltosRecord to AltosState
Keith Packard [Sun, 21 Oct 2012 23:13:14 +0000 (16:13 -0700)]
altoslib: Move computed state from AltosRecord to AltosState

Make AltosRecord simply track the raw data and have AltosState hold
all computed values, including cross-packet averages and computed speeds.

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

17 months agoaltoslib: Compute accelerometer speed from megametrum eeprom data
Keith Packard [Sun, 21 Oct 2012 21:11:07 +0000 (14:11 -0700)]
altoslib: Compute accelerometer speed from megametrum eeprom data

Duplicates code from the TM eeprom state tracking code.

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

17 months agoaltoslib: remove a couple of TM log record types from MM log parsing
Keith Packard [Sun, 21 Oct 2012 21:10:32 +0000 (14:10 -0700)]
altoslib: remove a couple of TM log record types from MM log parsing

PRESSURE and DEPLOY log records don't occurin MM eeprom files.

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

17 months agoaltoslib: MegaMetrum eeprom never loses GPS date
Keith Packard [Sun, 21 Oct 2012 20:42:00 +0000 (13:42 -0700)]
altoslib: MegaMetrum eeprom never loses GPS date

TeleMetrum had a firmware bug that would fail to record the GPS date
and time correctly, that was hacked around in altosui, but isn't
needed for MegaMetrum. Remove those hacks from the MM path.

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

17 months agoaltosui: Correct megametrum eeprom filename date
Keith Packard [Sun, 21 Oct 2012 20:02:40 +0000 (13:02 -0700)]
altosui: Correct megametrum eeprom filename date

Was fetching day-of-month from the year field

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

17 months agoaltosui: Add new filename filters
Keith Packard [Sun, 21 Oct 2012 20:02:05 +0000 (13:02 -0700)]
altosui: Add new filename filters

Allow the user to restrict filenames to telem, eeprom or mega files

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

17 months agoaltos/stm: Stop spewing clock out PA8 pin
Keith Packard [Sun, 21 Oct 2012 20:01:03 +0000 (13:01 -0700)]
altos/stm: Stop spewing clock out PA8 pin

This was used to debug the clock bringup, but is not useful anymore,
and probably a bad idea to boot.

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

18 months agoMerge branch 'master' into pwmin-new pwmin-new 1.1.9.1
Keith Packard [Thu, 18 Oct 2012 23:49:28 +0000 (16:49 -0700)]
Merge branch 'master' into pwmin-new

18 months agoaltosui: Re-add a couple of "unused" values
Keith Packard [Thu, 18 Oct 2012 23:19:38 +0000 (16:19 -0700)]
altosui: Re-add a couple of "unused" values

The values in these calls aren't needed, but the side-effects are, so
add them back in.

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

18 months agoBump version to 1.1.9.1
Keith Packard [Thu, 18 Oct 2012 23:02:59 +0000 (16:02 -0700)]
Bump version to 1.1.9.1

Prepare for Rocketober/Thrustration

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

18 months agoaltos/megametrum: Switch back to using the MS5607
Keith Packard [Thu, 18 Oct 2012 22:34:41 +0000 (15:34 -0700)]
altos/megametrum: Switch back to using the MS5607

We're planning to ship the MS5607

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

18 months agoMerge branch 'master' into mm-ms5611
Keith Packard [Thu, 18 Oct 2012 22:18:52 +0000 (15:18 -0700)]
Merge branch 'master' into mm-ms5611

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

18 months agoaltos: Build telescience-pwm product when possible
Keith Packard [Wed, 17 Oct 2012 05:33:34 +0000 (22:33 -0700)]
altos: Build telescience-pwm product when possible

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

18 months agoaltos: Add telescience-pwm product
Keith Packard [Wed, 17 Oct 2012 05:21:04 +0000 (22:21 -0700)]
altos: Add telescience-pwm product

Split out special PWM-sampling telescience product

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

18 months agoaltos: Only enable PWM on telescience_pwm product
Keith Packard [Wed, 17 Oct 2012 05:17:25 +0000 (22:17 -0700)]
altos: Only enable PWM on telescience_pwm product

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

18 months agotelescience: correctly calculating rate values with higher resolution
Robert Garbee [Thu, 19 Jul 2012 00:41:00 +0000 (18:41 -0600)]
telescience: correctly calculating rate values with higher resolution

18 months agoICP3 working
Robert Garbee [Wed, 18 Jul 2012 20:24:05 +0000 (14:24 -0600)]
ICP3 working

18 months agoTimer 3 working with slower clock and all 16 bits.
Robert Garbee [Wed, 18 Jul 2012 19:41:27 +0000 (13:41 -0600)]
Timer 3 working with slower clock and all 16 bits.

18 months agofirst work on PWM input to TeleScience, 'p' command displays timer 1
Robert Garbee [Tue, 17 Jul 2012 19:23:48 +0000 (13:23 -0600)]
first work on PWM input to TeleScience, 'p' command displays timer 1

18 months agotelescience: steal last adc channel for icp3 most recent value
Robert Garbee [Thu, 19 Jul 2012 17:40:20 +0000 (11:40 -0600)]
telescience: steal last adc channel for icp3 most recent value
Make the ICP3 rpm counter use in ao_adc_avr.c optional

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

18 months agoaltosui: Accept serial number of zero for eeprom download
Keith Packard [Wed, 17 Oct 2012 04:54:23 +0000 (21:54 -0700)]
altosui: Accept serial number of zero for eeprom download

AVR-based products don't have a valid serial number, and so usually
report 0. Accept this by making the 'no serial number' case check for
negative values.

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

18 months agoaltos/avr: Use ISR_BLOCK to disable interrupts during slave ISR
Keith Packard [Wed, 17 Oct 2012 04:08:58 +0000 (21:08 -0700)]
altos/avr: Use ISR_BLOCK to disable interrupts during slave ISR

This avoids enabling and then immediatly disabling them

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

18 months agoaltosui: Print exception stack trace when tracking flights
Keith Packard [Wed, 17 Oct 2012 00:14:05 +0000 (17:14 -0700)]
altosui: Print exception stack trace when tracking flights

More useful in fixing the problem

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

18 months agoaltosui: Handle missing pad distance in descent tab
Keith Packard [Wed, 17 Oct 2012 00:13:04 +0000 (17:13 -0700)]
altosui: Handle missing pad distance in descent tab

When the GPS isn't locked, the distance from the pad cannot be
computed and is left missing. Not crashing in this case is more useful.

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

18 months agoaltos/telelco: Make the RSSI led turn red when no packet is received
Keith Packard [Mon, 15 Oct 2012 07:24:57 +0000 (00:24 -0700)]
altos/telelco: Make the RSSI led turn red when no packet is received

This involved splitting out the notion of ever having received an
answer and having received an answer from the last query.

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

18 months agoaltos/telelco: 10ms is not enough time to get a packet back
Keith Packard [Mon, 15 Oct 2012 07:24:28 +0000 (00:24 -0700)]
altos/telelco: 10ms is not enough time to get a packet back

Not reliable, so bump to 20ms

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

18 months agoaltos/telelco: Only display every 10th box number during scan
Keith Packard [Mon, 15 Oct 2012 07:07:57 +0000 (00:07 -0700)]
altos/telelco: Only display every 10th box number during scan

This reduces the scan time to about 4 seconds, which seems tolerable

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

18 months agoaltos/telelco: Crank up SPI speed to cc1111
Keith Packard [Mon, 15 Oct 2012 07:06:57 +0000 (00:06 -0700)]
altos/telelco: Crank up SPI speed to cc1111

The cc1111 can handle up to 3MHz, so use 2MHz. Also, crank down the
packet wait time to 10ms, which should be plenty long for the remote
box to receive and return a packet.

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

18 months agoaltos/stm: Declare all SPI bus speeds
Keith Packard [Mon, 15 Oct 2012 07:06:10 +0000 (00:06 -0700)]
altos/stm: Declare all SPI bus speeds

Just list them all so users can pick what they like

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

18 months agoaltos/telelco: Actually set pad when it changes
Keith Packard [Mon, 15 Oct 2012 06:40:58 +0000 (23:40 -0700)]
altos/telelco: Actually set pad when it changes

Oops. Lost the actual assignment to the current pad

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

18 months agoaltos/telelco: Handle case where no boxes are present
Keith Packard [Mon, 15 Oct 2012 06:24:49 +0000 (23:24 -0700)]
altos/telelco: Handle case where no boxes are present

Don't infinite loop looking for something which isn't there

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

18 months agoaltos/telelco: Only present valid pads
Keith Packard [Mon, 15 Oct 2012 06:16:45 +0000 (23:16 -0700)]
altos/telelco: Only present valid pads

Limit pad display to valid pads, skipping missing ones.

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

18 months agoaltos/telefire: Report valid channels instead of valid pins
Keith Packard [Mon, 15 Oct 2012 06:04:44 +0000 (23:04 -0700)]
altos/telefire: Report valid channels instead of valid pins

Now that pins don't match channels 1:1, make sure that the report back
to the LCO names the channels instead of the pin numbers.

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

18 months agoaltos/test: Display MPU6000 values in ao_flight_test_mm output
Keith Packard [Sat, 13 Oct 2012 22:04:46 +0000 (15:04 -0700)]
altos/test: Display MPU6000 values in ao_flight_test_mm output

No computation yet, just making the values visible in the output

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

18 months agoaltos: Define full-scale gyro and accel values for MPU6000
Keith Packard [Sat, 13 Oct 2012 22:04:00 +0000 (15:04 -0700)]
altos: Define full-scale gyro and accel values for MPU6000

This lets other code convert MPU6000 readings into canonical units

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

18 months agoaltos: When missing MMA655x, create fake Z accel value
Keith Packard [Sat, 13 Oct 2012 22:02:42 +0000 (15:02 -0700)]
altos: When missing MMA655x, create fake Z accel value

This avoids overwriting the MPU6000 y acceleration value so that other
computations using that value can work unmodified.

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

18 months agoaltos/test: Add ao_flight_test_mm
Keith Packard [Sat, 13 Oct 2012 20:39:03 +0000 (13:39 -0700)]
altos/test: Add ao_flight_test_mm

This reads mega metrum eeprom files and runs the flight code over it

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

18 months agoaltos: Eliminate implicit 1 byte offset in uint16/int16 functions
Keith Packard [Sat, 13 Oct 2012 20:37:29 +0000 (13:37 -0700)]
altos: Eliminate implicit 1 byte offset in uint16/int16 functions

Make callers explicitly compute the full offset

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

18 months agoaltos: Split out ms5607 conversion code for use in ao_flight_test
Keith Packard [Sat, 13 Oct 2012 20:35:42 +0000 (13:35 -0700)]
altos: Split out ms5607 conversion code for use in ao_flight_test

Makes the conversion code available even where the driver isn't needed

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

18 months agoaltos: struct ao_log_mega doesn't have a ground temp value
Keith Packard [Sat, 13 Oct 2012 20:34:28 +0000 (13:34 -0700)]
altos: struct ao_log_mega doesn't have a ground temp value

There's no averaged ground temperature recorded in the flight system
to save there, so just remove the field

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

18 months agoaltos: Document a few member offsets in struct ao_log_record
Keith Packard [Sat, 13 Oct 2012 20:33:45 +0000 (13:33 -0700)]
altos: Document a few member offsets in struct ao_log_record

Incomplete, but useful even so

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

18 months agoaltosui: Parse .mega files from command line
Keith Packard [Sat, 13 Oct 2012 20:32:56 +0000 (13:32 -0700)]
altosui: Parse .mega files from command line

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

18 months agoaltos: Add .gitignore for micropeak
Keith Packard [Fri, 12 Oct 2012 21:27:14 +0000 (14:27 -0700)]
altos: Add .gitignore for micropeak

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

18 months agoaltos: Add (untested) driver for AT24C i2c flash parts
Keith Packard [Fri, 12 Oct 2012 21:26:08 +0000 (14:26 -0700)]
altos: Add (untested) driver for AT24C i2c flash parts

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

18 months agoaltos: Add initial micropeak implementation
Keith Packard [Fri, 12 Oct 2012 21:22:41 +0000 (14:22 -0700)]
altos: Add initial micropeak implementation

Blinks out max height in decimeters, stores previous flight data to
internal eeprom.

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

18 months agoaltos: Allow products to define which LED to panic with
Keith Packard [Fri, 12 Oct 2012 21:18:37 +0000 (14:18 -0700)]
altos: Allow products to define which LED to panic with

Continue to use AO_LED_RED by default.

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