fw/altos
18 months agoupdate changelog for Debian build debian/1.8.3-1
Bdale Garbee [Tue, 12 Dec 2017 04:40:52 +0000 (21:40 -0700)]
update changelog for Debian build

18 months agoMerge branch 'branch-1.8' into debian
Bdale Garbee [Tue, 12 Dec 2017 04:39:38 +0000 (21:39 -0700)]
Merge branch 'branch-1.8' into debian

18 months agoreleasing 1.8.3 1.8.3
Bdale Garbee [Tue, 12 Dec 2017 04:38:59 +0000 (21:38 -0700)]
releasing 1.8.3

18 months agoMerge branch 'master' into branch-1.8
Bdale Garbee [Tue, 12 Dec 2017 04:37:48 +0000 (21:37 -0700)]
Merge branch 'master' into branch-1.8

18 months agoTeleMega default is now v3.0
Bdale Garbee [Tue, 12 Dec 2017 04:33:21 +0000 (21:33 -0700)]
TeleMega default is now v3.0

18 months agodoc: Update release notes and docinfo for 1.8.3
Keith Packard [Tue, 12 Dec 2017 00:30:46 +0000 (16:30 -0800)]
doc: Update release notes and docinfo for 1.8.3

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltoslib: Keep old GPS values when updating data
Keith Packard [Mon, 11 Dec 2017 22:42:45 +0000 (14:42 -0800)]
altoslib: Keep old GPS values when updating data

This way, updating satellite information doesn't drop all of the
regular GPS data on the floor.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos: Actually store current MPU9250 data in data ring
Keith Packard [Mon, 11 Dec 2017 22:08:32 +0000 (14:08 -0800)]
altos: Actually store current MPU9250 data in data ring

The ring is updated when the ADC finishes; all of the other sensor
data needs to be copied in at that point.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos: Remove more software for hardware prototypes
Keith Packard [Mon, 11 Dec 2017 21:47:54 +0000 (13:47 -0800)]
altos: Remove more software for hardware prototypes

These never saw the light of day.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agotake telescience out of the routine builds
Bdale Garbee [Mon, 11 Dec 2017 21:44:15 +0000 (14:44 -0700)]
take telescience out of the routine builds

18 months agoBump to version 1.8.3
Keith Packard [Mon, 11 Dec 2017 20:23:29 +0000 (12:23 -0800)]
Bump to version 1.8.3

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agodoc: Note TeleMega v3.0 support in 1.8.3 relnotes
Keith Packard [Mon, 11 Dec 2017 20:23:00 +0000 (12:23 -0800)]
doc: Note TeleMega v3.0 support in 1.8.3 relnotes

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/drivers: Hook up mag sensor for MPU9250
Keith Packard [Tue, 5 Dec 2017 20:22:34 +0000 (12:22 -0800)]
altos/drivers: Hook up mag sensor for MPU9250

Set mag sensor to provide data at 100Hz.
Set i2c master to pull mag data at sample rate (200Hz).

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/scheme: Allow ao_scheme_read_eval_print to be restarted
Keith Packard [Mon, 11 Dec 2017 02:35:53 +0000 (18:35 -0800)]
altos/scheme: Allow ao_scheme_read_eval_print to be restarted

Reset exceptions at the top so that we can call it more than once.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos: Allow building with newlib + avr stdio on ARM
Keith Packard [Mon, 11 Dec 2017 02:34:49 +0000 (18:34 -0800)]
altos: Allow building with newlib + avr stdio on ARM

Redefines some stdio bits so that we can build with either pdclib or
newlib + avr stdio.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos: Add scheme for stm discovery board demo
Keith Packard [Mon, 11 Dec 2017 02:32:18 +0000 (18:32 -0800)]
altos: Add scheme for stm discovery board demo

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/lambdakey-v1.0: Switch to newlib, get things compiling again
Keith Packard [Mon, 11 Dec 2017 02:21:01 +0000 (18:21 -0800)]
altos/lambdakey-v1.0: Switch to newlib, get things compiling again

scheme is now way too large to fit on this device; some subsetting is
clearly indicated.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/scheme: Add Makefile for scheme test app
Keith Packard [Mon, 11 Dec 2017 00:55:57 +0000 (16:55 -0800)]
altos/scheme: Add Makefile for scheme test app

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/scheme: Make test scheme app heap maximum size
Keith Packard [Mon, 11 Dec 2017 00:54:50 +0000 (16:54 -0800)]
altos/scheme: Make test scheme app heap maximum size

It's only 32kB.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/scheme: Make eqv? work for numbers and strings
Keith Packard [Mon, 11 Dec 2017 00:53:25 +0000 (16:53 -0800)]
altos/scheme: Make eqv? work for numbers and strings

Large numbers, floats and strings need a value check, not just a
comparison between ao_polys

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/scheme: Stash cons across value allocation in compare
Keith Packard [Mon, 11 Dec 2017 00:52:26 +0000 (16:52 -0800)]
altos/scheme: Stash cons across value allocation in compare

Large ints, strings and floats can cause allocation, requiring that
the 'cons' pointer be stashed and retrieved in case it moved.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/scheme: add list-copy
Keith Packard [Mon, 11 Dec 2017 00:51:25 +0000 (16:51 -0800)]
altos/scheme: add list-copy

A lot easier as a built-in; the obvious scheme version is recursive.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/scheme: Use 64-bit ints to track memory allocation stats
Keith Packard [Mon, 11 Dec 2017 00:50:06 +0000 (16:50 -0800)]
altos/scheme: Use 64-bit ints to track memory allocation stats

These are only collected for debug purposes, but can get quite large
if the interpreter runs for a while.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/scheme: Add a bunch of string and vector builtins
Keith Packard [Sun, 10 Dec 2017 21:13:27 +0000 (13:13 -0800)]
altos/scheme: Add a bunch of string and vector builtins

Just make the language closer to r7rs

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoTeleMega v3.0 turnon scripts
Bdale Garbee [Mon, 11 Dec 2017 17:17:40 +0000 (10:17 -0700)]
TeleMega v3.0 turnon scripts

18 months agoMerge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Bdale Garbee [Mon, 11 Dec 2017 17:16:24 +0000 (10:16 -0700)]
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos

18 months agoaltos/scheme: Avoid crashing with non-list in length
Keith Packard [Sun, 10 Dec 2017 08:02:34 +0000 (00:02 -0800)]
altos/scheme: Avoid crashing with non-list in length

Use ao_scheme_cons_cdr to fetch the next list element as that returns
NULL for non-cons elements.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/scheme: Add vectors
Keith Packard [Sun, 10 Dec 2017 08:02:00 +0000 (00:02 -0800)]
altos/scheme: Add vectors

Constant time and smaller can be a feature.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/scheme: Fix name of constant scheme file
Keith Packard [Sun, 10 Dec 2017 08:00:23 +0000 (00:00 -0800)]
altos/scheme: Fix name of constant scheme file

.lisp -> .scheme

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltoslib: Fix 8 to 12 bit conversion for Mega pyro voltage data
Keith Packard [Sun, 10 Dec 2017 00:57:35 +0000 (16:57 -0800)]
altoslib: Fix 8 to 12 bit conversion for Mega pyro voltage data

The conversion was losing the replicated top four bits by shifting by
the wrong amount.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/scheme: Let readline know if there's a list in progress
Keith Packard [Sun, 10 Dec 2017 00:56:20 +0000 (16:56 -0800)]
altos/scheme: Let readline know if there's a list in progress

This lets the interactive prompt change based on what state the lexer
is in

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoMerge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Bdale Garbee [Tue, 5 Dec 2017 20:23:09 +0000 (13:23 -0700)]
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos

18 months agoaltos/drivers: Start adding defines to get mag data out of MPU9250
Keith Packard [Tue, 5 Dec 2017 20:22:34 +0000 (12:22 -0800)]
altos/drivers: Start adding defines to get mag data out of MPU9250

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agomoving to TeleMega v3.0 by default
Bdale Garbee [Tue, 5 Dec 2017 20:18:45 +0000 (13:18 -0700)]
moving to TeleMega v3.0 by default

18 months agohandle repeated invocations without failing as often
Bdale Garbee [Tue, 5 Dec 2017 20:17:18 +0000 (13:17 -0700)]
handle repeated invocations without failing as often

18 months agoaltos/cortexelf-v1: Adapt to lisp->scheme name change
Keith Packard [Tue, 5 Dec 2017 18:48:04 +0000 (10:48 -0800)]
altos/cortexelf-v1: Adapt to lisp->scheme name change

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/scheme: Add explicit dependency on ao_scheme_builtin.h for ao_scheme_make_const
Keith Packard [Tue, 5 Dec 2017 18:42:02 +0000 (10:42 -0800)]
altos/scheme: Add explicit dependency on ao_scheme_builtin.h for ao_scheme_make_const

This ensures that a parallel build will wait for ao_scheme_builtin.h
to be complete before attempting to compile ao_scheme_make_const

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/scheme: Move scheme test program to scheme sub-directory
Keith Packard [Tue, 5 Dec 2017 18:38:14 +0000 (10:38 -0800)]
altos/scheme: Move scheme test program to scheme sub-directory

Keeps it away from the usual test setup

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/scheme: Rename to 'scheme', clean up build
Keith Packard [Tue, 5 Dec 2017 18:29:13 +0000 (10:29 -0800)]
altos/scheme: Rename to 'scheme', clean up build

Constant block is now built in a subdir to avoid messing up source
directory.

Renamed to ao_scheme to reflect language target.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/lisp: Switch to scheme formal syntax for varargs
Keith Packard [Mon, 4 Dec 2017 03:54:18 +0000 (19:54 -0800)]
altos/lisp: Switch to scheme formal syntax for varargs

Scheme uses bare symbols to indicate a varargs parameter; any bare
(i.e., not wrapped in a cons cell) parameter will get the 'rest' of
the parameter list. This works for lambdas, nlambdas and macros. As a
result, the 'lexpr' form has been removed as it is equivalent to a
lambda with a varargs formal.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/lisp: Fix stash usage across frame allocation
Keith Packard [Mon, 4 Dec 2017 03:52:11 +0000 (19:52 -0800)]
altos/lisp: Fix stash usage across frame allocation

Must un-stash before allocation failure check.
Use frame_stash instead of poly_stash for frames.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/lisp: Check only cdr base type when moving cons cells
Keith Packard [Mon, 4 Dec 2017 03:49:20 +0000 (19:49 -0800)]
altos/lisp: Check only cdr base type when moving cons cells

The cdr may have moved, so we can't look at the target object
type. Fortunately, the base type encoded in the reference itself is
sufficient to check for a non-cons cdr.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/lisp: Split out read debug, add memory validation
Keith Packard [Mon, 4 Dec 2017 03:47:03 +0000 (19:47 -0800)]
altos/lisp: Split out read debug, add memory validation

Split read debug into a separate #define to reduce debug noise
Add some memory validation -- validate stash API, and validate
cons_free calls.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/lisp: use strtof instead of atof
Keith Packard [Sun, 3 Dec 2017 05:21:55 +0000 (23:21 -0600)]
altos/lisp: use strtof instead of atof

atof returns double, strtof returns float.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/lisp: Convert more builtin lisp code to scheme format
Keith Packard [Sun, 3 Dec 2017 05:21:01 +0000 (23:21 -0600)]
altos/lisp: Convert more builtin lisp code to scheme format

Use defines where possible, use (define (name args ...)) form for lambdas

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/lisp: Overflow int computations to float
Keith Packard [Sun, 3 Dec 2017 05:19:44 +0000 (23:19 -0600)]
altos/lisp: Overflow int computations to float

When an int computation overflows, switch to float.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltoslib: Add support for TeleMega v3.0 log files
Keith Packard [Sat, 2 Dec 2017 21:59:17 +0000 (15:59 -0600)]
altoslib: Add support for TeleMega v3.0 log files

These look much like TeleMega v2.0 log files, except that the mag
sensor data now comes from the mpu9250 instead of an external
hmc5883. The gyro and 3-axis accel data from the mpu9250 are the same
as the mpu6000.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos: Build TeleMega v3.0 by default
Keith Packard [Sat, 2 Dec 2017 21:53:05 +0000 (15:53 -0600)]
altos: Build TeleMega v3.0 by default

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos: Add TeleMega v3.0
Keith Packard [Sat, 2 Dec 2017 21:31:06 +0000 (15:31 -0600)]
altos: Add TeleMega v3.0

Adds files to build telemega v3.0 flash loader and firmware

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/kernel: MPU9250 support
Keith Packard [Sat, 2 Dec 2017 21:32:38 +0000 (15:32 -0600)]
altos/kernel: MPU9250 support

Use MPU9250 for accel, gyro and mag data in logging, telemetry and
flight status computations.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/lisp: split set/def. Add def support to lambdas
Keith Packard [Fri, 1 Dec 2017 21:40:23 +0000 (15:40 -0600)]
altos/lisp: split set/def. Add def support to lambdas

In scheme, set can only re-define existing variables while def cannot
redefine existing variables in lambda context. Def within lambda
creates a new variable at the nearest enclosing scope.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/lisp: Split out frame vals from frame struct
Keith Packard [Fri, 1 Dec 2017 17:28:16 +0000 (18:28 +0100)]
altos/lisp: Split out frame vals from frame struct

This lets the frame be resized without moving the base structure. The
plan is to allow all frames to be resized, not just the global frame.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/lisp: Make let distinct from let*
Keith Packard [Fri, 1 Dec 2017 11:06:04 +0000 (12:06 +0100)]
altos/lisp: Make let distinct from let*

let is supposed to define the values all at once, evaluating the
initializers in the enclosing context. let* defines the new names and
then initializes them one at a time.

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/lisp: return from unmatched cond is #f, not nil
Keith Packard [Fri, 1 Dec 2017 10:32:27 +0000 (11:32 +0100)]
altos/lisp: return from unmatched cond is #f, not nil

Fix the return value when we fall off the end of a cond expression to
be #f

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/lisp: Fix pairp builtin
Keith Packard [Fri, 1 Dec 2017 10:31:29 +0000 (11:31 +0100)]
altos/lisp: Fix pairp builtin

Pairs are non-nil cons values; add an explicit check for nil here

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/lisp: Add quasiquote
Keith Packard [Fri, 1 Dec 2017 09:12:38 +0000 (10:12 +0100)]
altos/lisp: Add quasiquote

This adds read support for quasiquote syntax, and then adds a
quasiquote implementation in lisp

Signed-off-by: Keith Packard <keithp@keithp.com>
18 months agoaltos/lisp: Rename progn to begin
Keith Packard [Sun, 26 Nov 2017 01:29:10 +0000 (17:29 -0800)]
altos/lisp: Rename progn to begin

Match scheme name.

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/test: Update to build altos lisp test app
Keith Packard [Mon, 20 Nov 2017 05:07:23 +0000 (21:07 -0800)]
altos/test: Update to build altos lisp test app

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/lisp: Add floats
Keith Packard [Mon, 20 Nov 2017 05:07:00 +0000 (21:07 -0800)]
altos/lisp: Add floats

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/lisp: Fix some scheme compat issues
Keith Packard [Sun, 19 Nov 2017 06:00:44 +0000 (22:00 -0800)]
altos/lisp: Fix some scheme compat issues

flush -> flush-output
nth -> list-ref (oh, and add list-tail)
add let* (same as let for now)
write control chars in octal
make hanoi example work

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/lisp: Add 'big' ints -- 24 bits wide
Keith Packard [Sun, 19 Nov 2017 04:38:15 +0000 (20:38 -0800)]
altos/lisp: Add 'big' ints -- 24 bits wide

With the default ints being only 14 bits, having a larger type with
more precision seems useful. This is not exposed to the application.

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/cortexelf-v1: Make lisp compile again
Keith Packard [Sat, 18 Nov 2017 07:28:08 +0000 (23:28 -0800)]
altos/cortexelf-v1: Make lisp compile again

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/test: Add jiffy funcs to lisp test
Keith Packard [Sat, 18 Nov 2017 07:27:36 +0000 (23:27 -0800)]
altos/test: Add jiffy funcs to lisp test

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/lisp: Finish first pass through r7rs
Keith Packard [Sat, 18 Nov 2017 07:23:50 +0000 (23:23 -0800)]
altos/lisp: Finish first pass through r7rs

* print -> write, patom -> display
* Add read-char, write-char
* Add exit, current-jiffy, current-second, jiffies-per-second
* Add for-each and string-for-each
* Avoid duplicate builtins with different atoms

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/lisp: Add apply
Keith Packard [Sat, 18 Nov 2017 06:14:19 +0000 (22:14 -0800)]
altos/lisp: Add apply

And all of the library routines that use it, map, string-map and friends.

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/lisp: Character consts. String and assoc builtins.
Keith Packard [Fri, 17 Nov 2017 16:50:50 +0000 (08:50 -0800)]
altos/lisp: Character consts. String and assoc builtins.

Also add back escaped characters in strings.

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/lisp: Generate built-in lambda atoms for const creation
Keith Packard [Fri, 17 Nov 2017 16:04:28 +0000 (08:04 -0800)]
altos/lisp: Generate built-in lambda atoms for const creation

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/test: More lisp test Makefile fixes
Keith Packard [Fri, 17 Nov 2017 06:15:06 +0000 (22:15 -0800)]
altos/test: More lisp test Makefile fixes

Depend on ao_lisp_const.h

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/lisp: Lots more scheme bits
Keith Packard [Fri, 17 Nov 2017 06:13:46 +0000 (22:13 -0800)]
altos/lisp: Lots more scheme bits

* Arithmetic functions and tests
* append, reverse and list-tail
* set-car! and set-cdr!

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/test: Get lisp test building using Makefile-inc
Keith Packard [Fri, 17 Nov 2017 02:47:34 +0000 (18:47 -0800)]
altos/test: Get lisp test building using Makefile-inc

Instead of re-defining all of the lisp sources and headers

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/lisp: More schemisms
Keith Packard [Fri, 17 Nov 2017 02:46:03 +0000 (18:46 -0800)]
altos/lisp: More schemisms

Add 'if'.
setq -> set!, but doesn't define new variables
def -> define
Add pair? and list?
Add eq? and eqv? as aliases for =

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/lisp: Add 'else' sematics to cond
Keith Packard [Fri, 17 Nov 2017 02:41:18 +0000 (18:41 -0800)]
altos/lisp: Add 'else' sematics to cond

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/lisp: Add scheme-style bools (#t and #f)
Keith Packard [Fri, 17 Nov 2017 01:49:47 +0000 (17:49 -0800)]
altos/lisp: Add scheme-style bools (#t and #f)

Cond and while compare against #f, just like scheme says to.

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/lisp: Add non-cons cdr support
Keith Packard [Thu, 16 Nov 2017 21:02:07 +0000 (13:02 -0800)]
altos/lisp: Add non-cons cdr support

The cdr of a cons can be any value; add support for lexing and
printing them.

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agodoc: Update for 1.8.3
Keith Packard [Sun, 12 Nov 2017 05:29:11 +0000 (21:29 -0800)]
doc: Update for 1.8.3

Also added a pile of docinfo files for older release notes files.

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos: Fix new GCC warnings
Keith Packard [Sun, 12 Nov 2017 04:52:01 +0000 (20:52 -0800)]
altos: Fix new GCC warnings

* Duplicate 'const' in test code.
* Mis-formatted loop in kf_rem_pio2
* Unused 'one' in sf_cos

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos: Fix inverted test for corrupt flight log
Keith Packard [Sun, 12 Nov 2017 04:50:45 +0000 (20:50 -0800)]
altos: Fix inverted test for corrupt flight log

Was reporting correct flight log as corrupted. Oops.

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltoslib: Improve EEprom download
Keith Packard [Sun, 12 Nov 2017 04:49:20 +0000 (20:49 -0800)]
altoslib: Improve EEprom download

* Catch and report CRC errors
* Deal with corrupted flight records
* Add ability to immediately graph new data
* Check before overwriting existing files

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltoslib: Remove spurious semicolon in AltosReplayReader.java
Keith Packard [Sun, 12 Nov 2017 04:46:45 +0000 (20:46 -0800)]
altoslib: Remove spurious semicolon in AltosReplayReader.java

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltoslib: Don't write KML record when height data is missing
Keith Packard [Sun, 12 Nov 2017 04:44:27 +0000 (20:44 -0800)]
altoslib: Don't write KML record when height data is missing

This avoids a crash dealing with corrupted flight data

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/test: Adapt flight test to int16_t flight number type
Keith Packard [Sun, 12 Nov 2017 00:38:40 +0000 (16:38 -0800)]
altos/test: Adapt flight test to int16_t flight number type

Flight numbers are now limited to 32767 to allow for negative values
for corrupted slots.

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltosuilib: New line styles and colors for graphs. Selectable line width
Keith Packard [Sun, 12 Nov 2017 00:08:32 +0000 (16:08 -0800)]
altosuilib: New line styles and colors for graphs. Selectable line width

Improve the readability of graphs by offering a better selection of
colors and adding line styles. Let the user configure the line width
as desired.

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos/stm: Add AO_EXTI_MODE_PULL_NONE
Keith Packard [Thu, 2 Nov 2017 16:12:18 +0000 (09:12 -0700)]
altos/stm: Add AO_EXTI_MODE_PULL_NONE

This is clearer than using '0'.

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos: whitespace cleanup in ao_adc_stm.c
Keith Packard [Thu, 2 Nov 2017 16:11:39 +0000 (09:11 -0700)]
altos: whitespace cleanup in ao_adc_stm.c

Signed-off-by: Keith Packard <keithp@keithp.com>
19 months agoaltos: Share common logging code. Deal with corrupt initial flight records
Keith Packard [Sun, 22 Oct 2017 20:44:32 +0000 (15:44 -0500)]
altos: Share common logging code. Deal with corrupt initial flight records

Move common logging APIs from per-format files into ao_log.c. Then,
change that code to check the first log record in a slot (containing
the flight number) to see if it's invalid and deal with it. That
involves not re-using that slot, and allowing it to be erased.

Corrupted log blocks are reported with a negative flight number.

Signed-off-by: Keith Packard <keithp@keithp.com>
20 months agoaltos: Define AO_LOG_FORMAT in */ao_pins.h. Use in ao_cmd.c
Keith Packard [Sun, 22 Oct 2017 20:43:07 +0000 (15:43 -0500)]
altos: Define AO_LOG_FORMAT in */ao_pins.h. Use in ao_cmd.c

Instead of having a global variable define the log format, use a macro
instead to save data space.

Signed-off-by: Keith Packard <keithp@keithp.com>
20 months agoaltos: Remove cross-block storage I/O on cc1111
Keith Packard [Sun, 22 Oct 2017 20:39:25 +0000 (15:39 -0500)]
altos: Remove cross-block storage I/O on cc1111

We don't ever need to be able to do storage read/write across chunks
of flash on the old cc1111 products, so remove the loops that support
it to save space.

Signed-off-by: Keith Packard <keithp@keithp.com>
20 months agoaltoslib: Move temp GPS API from cal_data to data_listener
Keith Packard [Sun, 22 Oct 2017 19:04:09 +0000 (14:04 -0500)]
altoslib: Move temp GPS API from cal_data to data_listener

This makes the API more consistent, and means that the listener is
responsible for mangaing the temp gps state. In particular, the
AltosDataListener set_gps API now calls the cal_data function.

Signed-off-by: Keith Packard <keithp@keithp.com>
20 months agoaltoslib: Save separate config for local and remote. Use in idle
Keith Packard [Sat, 14 Oct 2017 19:18:26 +0000 (12:18 -0700)]
altoslib: Save separate config for local and remote. Use in idle

When using the remote link, there are two separate configuration data
blocks, that for the local device and for remote. Make the link report
both versions, depending on whether it is in remote mode or not.

Request config data in remote mode when running idle monitoring so
that the presented data is for the remote device, not the local one.

Signed-off-by: Keith Packard <keithp@keithp.com>
20 months agoaltoslib: Report un-adjusted ground accel in idle IMU monitor
Keith Packard [Sat, 14 Oct 2017 19:05:07 +0000 (12:05 -0700)]
altoslib: Report un-adjusted ground accel in idle IMU monitor

The ground accel is the basis of the accel adjustment, so it needs to
be delivered in un-adjusted form.

Signed-off-by: Keith Packard <keithp@keithp.com>
20 months agoaltos: Add MPU9250 support to self test and data
Keith Packard [Thu, 12 Oct 2017 07:31:26 +0000 (00:31 -0700)]
altos: Add MPU9250 support to self test and data

The remaining hooks to make the MPU9250 work in flight.

Signed-off-by: Keith Packard <keithp@keithp.com>
20 months agoaltoslib: Fix time series filter window computation
Keith Packard [Thu, 12 Oct 2017 07:30:23 +0000 (00:30 -0700)]
altoslib: Fix time series filter window computation

Small floating point rounding errors could lead to NaNs.

Signed-off-by: Keith Packard <keithp@keithp.com>
20 months agoaltoslib: Don't crash if there's no GPS coord to write KML
Keith Packard [Thu, 12 Oct 2017 07:29:07 +0000 (00:29 -0700)]
altoslib: Don't crash if there's no GPS coord to write KML

Just check for null before writing as a precaution.

Signed-off-by: Keith Packard <keithp@keithp.com>
20 months agoaltoslib: Allow gps time later than requested if it's first
Keith Packard [Thu, 12 Oct 2017 07:26:31 +0000 (00:26 -0700)]
altoslib: Allow gps time later than requested if it's first

When generating a KML file, we want to position markers near the start
of the flight section. This is done by looking for a GPS coordinate
'before' the starting point of the flight, which doesn't work well
when the first GPS coordinate is later than that. Pick the first point
after the chosen time if there isn't an earlier one.

Signed-off-by: Keith Packard <keithp@keithp.com>
20 months agoaltos: Add MPU9250 driver (accel/gyro only for now)
Keith Packard [Thu, 12 Oct 2017 07:14:30 +0000 (00:14 -0700)]
altos: Add MPU9250 driver (accel/gyro only for now)

This is almost an exact copy of the MPU6000 driver, just a few minor
register changes.

Signed-off-by: Keith Packard <keithp@keithp.com>
20 months agoaltos: Stop storing pyro fired status in config block
Keith Packard [Mon, 9 Oct 2017 01:50:59 +0000 (18:50 -0700)]
altos: Stop storing pyro fired status in config block

We already have the fired status saved in the ao_pyro_fired variable,
so just use that to detect whether a channel has already been fired.

Fixes possible cases where the pyro config data gets written back to
eeprom with the fired bit set, which then inhibits the channel during
flight.

Signed-off-by: Keith Packard <keithp@keithp.com>
20 months agoSet version to 1.8.2.1
Keith Packard [Thu, 5 Oct 2017 23:46:08 +0000 (16:46 -0700)]
Set version to 1.8.2.1

Testing KML export changes at TRA

Signed-off-by: Keith Packard <keithp@keithp.com>
20 months agoaltoslib: Missing file for filter additions.
Keith Packard [Wed, 4 Oct 2017 20:44:31 +0000 (13:44 -0700)]
altoslib: Missing file for filter additions.

Signed-off-by: Keith Packard <keithp@keithp.com>
20 months agoaltosuilib: Add 'show marker' button to graphs
Keith Packard [Wed, 4 Oct 2017 20:43:45 +0000 (13:43 -0700)]
altosuilib: Add 'show marker' button to graphs

Provides a marker at each actual data point which can be useful for
sparse data sets like telemetry with poor reception.

Signed-off-by: Keith Packard <keithp@keithp.com>
20 months agoaltoslib: Adapt KML output to make TRA record people happier
Keith Packard [Wed, 4 Oct 2017 20:42:16 +0000 (13:42 -0700)]
altoslib: Adapt KML output to make TRA record people happier

Provide two paths, one using GPS data the other baro. Replace separate
path segments for each state with markers so that the path is a single
unit, able to be displayed in the elevation profile widget.

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