fw/altos
12 months agoaltos-map: Switch from json FD ops to json FILE ops
Keith Packard [Sun, 7 Oct 2018 17:32:48 +0000 (10:32 -0700)]
altos-map: Switch from json FD ops to json FILE ops

Older versions (in Debian stable) do not have the fd-based operations.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltos-mapd: Handle clients failing to send valid JSON
Keith Packard [Sun, 7 Oct 2018 17:03:31 +0000 (10:03 -0700)]
altos-mapd: Handle clients failing to send valid JSON

Just bail if the data we receive doesn't generate a json value.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltosuilib: InputEvent.getModifiers is deprecated, use getModifiersEx
Keith Packard [Sun, 7 Oct 2018 17:02:26 +0000 (10:02 -0700)]
altosuilib: InputEvent.getModifiers is deprecated, use getModifiersEx

Some java change; seems like it's a no-op for us.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltosui/altosdroid: Disable offline map type selections
Keith Packard [Sun, 7 Oct 2018 17:01:30 +0000 (10:01 -0700)]
altosui/altosdroid: Disable offline map type selections

Our server only supports hybrid maps for now. If that changes, we can
re-add this support easily enough.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltosuilib: Remove GrabNDrag.java
Keith Packard [Sun, 7 Oct 2018 16:39:27 +0000 (09:39 -0700)]
altosuilib: Remove GrabNDrag.java

This isn't used anymore.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agomap-server: Implement altos-map in C
Keith Packard [Sun, 7 Oct 2018 16:22:44 +0000 (09:22 -0700)]
map-server: Implement altos-map in C

This app is all about startup time, and java starts
slowly. Re-implement in C to improve server performance.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltosdroid: Restore google maps key setting
Keith Packard [Sun, 7 Oct 2018 06:32:24 +0000 (23:32 -0700)]
altosdroid: Restore google maps key setting

Only for altosdroid, and use a key restricted to our app

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltosdroid: Set offline map scale to 1
Keith Packard [Sun, 7 Oct 2018 06:25:50 +0000 (23:25 -0700)]
altosdroid: Set offline map scale to 1

Offline maps only supports scale 1 now.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltos-mapd: Install systemd service file and defaults file
Keith Packard [Sun, 7 Oct 2018 05:22:26 +0000 (23:22 -0600)]
altos-mapd: Install systemd service file and defaults file

This lets the map service 'just work' if enabled.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltos-map: Support version query from application
Keith Packard [Sun, 7 Oct 2018 04:32:12 +0000 (21:32 -0700)]
altos-map: Support version query from application

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltosuilib: Fix offline map messages to match new meanings
Keith Packard [Sun, 7 Oct 2018 04:30:03 +0000 (21:30 -0700)]
altosuilib: Fix offline map messages to match new meanings

forbidden means outside of launch area.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltoslib: Retry map connections 10 times on network failure
Keith Packard [Sun, 7 Oct 2018 04:30:58 +0000 (21:30 -0700)]
altoslib: Retry map connections 10 times on network failure

This covers a host of problems between the application and google maps.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltosdroid: Fix offline map messages to match new meanings
Keith Packard [Sun, 7 Oct 2018 04:30:03 +0000 (21:30 -0700)]
altosdroid: Fix offline map messages to match new meanings

forbidden means outside of launch area.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltoslib: Change map loading to lat=&lon= from center=
Keith Packard [Sun, 7 Oct 2018 03:21:07 +0000 (20:21 -0700)]
altoslib: Change map loading to lat=&lon= from center=

This is easier to parse.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltoslib: Use https for launch-sites.txt
Keith Packard [Sun, 7 Oct 2018 03:20:33 +0000 (20:20 -0700)]
altoslib: Use https for launch-sites.txt

http causes a redirect, which Java doesn't handle

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltos-mapd: Install altosmapd.jar file
Keith Packard [Sun, 7 Oct 2018 04:28:36 +0000 (22:28 -0600)]
altos-mapd: Install altosmapd.jar file

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltos-mapd: Make cache service listen queue longer
Keith Packard [Sun, 7 Oct 2018 04:27:58 +0000 (22:27 -0600)]
altos-mapd: Make cache service listen queue longer

Just in case the service gets busy, make the listen queue longer.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltos-mapd: Clean up log messages
Keith Packard [Sun, 7 Oct 2018 04:27:20 +0000 (22:27 -0600)]
altos-mapd: Clean up log messages

Generate a single log message per request with remote address,
parameters and result code.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltos-mapd: remove debug printf
Keith Packard [Sun, 7 Oct 2018 04:26:46 +0000 (22:26 -0600)]
altos-mapd: remove debug printf

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltos-map: Retry connection to cache service
Keith Packard [Sun, 7 Oct 2018 04:25:48 +0000 (22:25 -0600)]
altos-map: Retry connection to cache service

Just in case the cache service gets busy, retry the connection instead
of immediately failing.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltos-mapd: Add geo-fencing for map requests. Add port and key arguments
Keith Packard [Sun, 7 Oct 2018 02:33:51 +0000 (19:33 -0700)]
altos-mapd: Add geo-fencing for map requests. Add port and key arguments

Map requests are now limited to a region within 17km of any registered
launch site.

The --port argument allows the listen port to be changed.

The --key argument provides the name of a file containing the Google
maps API key.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltoslib: Switch to maps.altusmetrum.org when no google map key is available
Keith Packard [Sun, 7 Oct 2018 02:29:01 +0000 (19:29 -0700)]
altoslib: Switch to maps.altusmetrum.org when no google map key is available

The map key is only usable from maps.altusmetrum.org at this point,
and that service will be proxying for everyone in the near future.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltoslib: Allow launch site URL to be overridden at runtime
Keith Packard [Sun, 7 Oct 2018 02:27:43 +0000 (19:27 -0700)]
altoslib: Allow launch site URL to be overridden at runtime

Expose a public variable, AltosLaunchSites.launch_sites_url, that will
be used in place of the environment variable or pre-defined value.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoMerge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Bdale Garbee [Sun, 7 Oct 2018 00:55:05 +0000 (18:55 -0600)]
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos

12 months agoaltoslib: update launch-sites.txt location to new home at maps.altusmetrum.org
Bdale Garbee [Sun, 7 Oct 2018 00:54:35 +0000 (18:54 -0600)]
altoslib: update launch-sites.txt location to new home at maps.altusmetrum.org

12 months agodoc: Make use of 'faketime' configurable with configure.ac. Default to 'no'
Keith Packard [Sun, 7 Oct 2018 00:17:20 +0000 (17:17 -0700)]
doc: Make use of 'faketime' configurable with configure.ac. Default to 'no'

This ensures that older a2x versions don't simply wedge while building
the docs.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltos-mapd: Use command line to pass map directory in
Keith Packard [Sun, 7 Oct 2018 00:11:48 +0000 (18:11 -0600)]
altos-mapd: Use command line to pass map directory in

Don't bother with a default value, just require a command line param.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltos-map: Install .jar file for altos-map
Keith Packard [Sun, 7 Oct 2018 00:11:13 +0000 (18:11 -0600)]
altos-map: Install .jar file for altos-map

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltos-map: Fix altos-map HTTP syntax
Keith Packard [Sun, 7 Oct 2018 00:10:57 +0000 (18:10 -0600)]
altos-map: Fix altos-map HTTP syntax

Add blank line between header and content.
Make error pages have actual HTML content.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agomap-server: Add maps proxy server
Keith Packard [Sat, 6 Oct 2018 23:04:39 +0000 (16:04 -0700)]
map-server: Add maps proxy server

This creates a map proxy server to handle the new Google Maps API requirements

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoAdd map-loading documentation
Keith Packard [Sat, 6 Oct 2018 19:00:45 +0000 (12:00 -0700)]
Add map-loading documentation

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agodoc: Use RELEASE_DATE to set PDF timestamps using faketime
Keith Packard [Sat, 6 Oct 2018 04:40:13 +0000 (21:40 -0700)]
doc: Use RELEASE_DATE to set PDF timestamps using faketime

This ensures that the generated PDF files do not depend on the time of
the build and only on the date of the release.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agomacosx: Ship install-macosx script with all apps.
Keith Packard [Sat, 6 Oct 2018 02:36:20 +0000 (19:36 -0700)]
macosx: Ship install-macosx script with all apps.

This script copies all files to ~/Applications/AltOS, then it deletes
all xattrs on all files so that OS X will run the java programs.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agodoc: Add check for new hardware in specs.inc
Keith Packard [Sat, 6 Oct 2018 01:22:59 +0000 (18:22 -0700)]
doc: Add check for new hardware in specs.inc

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agodoc: Update for 1.8.7
Keith Packard [Sat, 6 Oct 2018 01:22:11 +0000 (18:22 -0700)]
doc: Update for 1.8.7

Release notes
Add HW specs for EasyMini v2.0 and TeleMega v3.0

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltos: Force telemetry rate to 38400 when ao_force_freq is set
Keith Packard [Fri, 5 Oct 2018 06:10:59 +0000 (23:10 -0700)]
altos: Force telemetry rate to 38400 when ao_force_freq is set

ao_force_freq is used by TeleMini to set the radio to known
values. As TeleMini v3.0 also has configurable telemetry rates, this
value also needs to be set back to a known value.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agodoc: Describe Packet Link mode in the initial usage section
Keith Packard [Fri, 5 Oct 2018 06:03:12 +0000 (23:03 -0700)]
doc: Describe Packet Link mode in the initial usage section

It's not described in any detail elsewhere...

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agodoc: Describe Packet Link usage and selecting RF param defaults for TeleMini
Keith Packard [Fri, 5 Oct 2018 05:58:38 +0000 (22:58 -0700)]
doc: Describe Packet Link usage and selecting RF param defaults for TeleMini

Packet Link mode is the only communication method available for
TeleMini and deserves some special mention in the docs.

TeleMini allows forcing of RF parameters back to known defaults by
hooking SWCLK to ground at power on (hole 7 to hole 3 on the debug
connector). Describe this process so that users will be able to get
TeleMini back to known values and recover.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltoslib: Add missing AltosUnitInfo files
Keith Packard [Thu, 4 Oct 2018 19:12:56 +0000 (12:12 -0700)]
altoslib: Add missing AltosUnitInfo files

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltoslib: Fix gyro headings in CSV files
Keith Packard [Tue, 11 Sep 2018 07:06:05 +0000 (00:06 -0700)]
altoslib: Fix gyro headings in CSV files

Use yaw/pitch/roll instead of x/y/z

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoao-bringup: Add 'fix-telebt' to reflash TeleBT v4.0 with correct rf cal
Keith Packard [Wed, 3 Oct 2018 00:27:31 +0000 (17:27 -0700)]
ao-bringup: Add 'fix-telebt' to reflash TeleBT v4.0 with correct rf cal

Fetches RF calibration value from the net and applies that when reflashing.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltosui: Fetch RF calibration value for TBT v4.0 units from web
Keith Packard [Wed, 3 Oct 2018 00:03:28 +0000 (17:03 -0700)]
altosui: Fetch RF calibration value for TBT v4.0 units from web

We shipped a pile of TBT v4.0 units without programming the RF
calibration value into flash. This change checks to see if the target
is in the right serial number range and has the default RF calibration
value, in which case it fetches the RF calibration value from our web
site.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltos: sdcc doesn't have 'false' and 'true'.
Keith Packard [Tue, 2 Oct 2018 20:57:58 +0000 (13:57 -0700)]
altos: sdcc doesn't have 'false' and 'true'.

Use FALSE and TRUE in ms5607.c driver instead.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoao-tools/ao-cal-freq: Add --nosave and --output options. Check save results.
Keith Packard [Tue, 2 Oct 2018 19:57:06 +0000 (12:57 -0700)]
ao-tools/ao-cal-freq: Add --nosave and --output options. Check save results.

--nosave means don't attempt to update the on-device configuration
  data in eeprom.

--output means write the calibration value to a file.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agomicropeak: Add MicroUSB 'equals' method
Keith Packard [Tue, 2 Oct 2018 19:49:12 +0000 (12:49 -0700)]
micropeak: Add MicroUSB 'equals' method

This lets the code which polls for devices work with MicroUSB devices
too.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agodoc: Don't accidentally create zero-length PDF files
Keith Packard [Wed, 22 Aug 2018 07:59:59 +0000 (00:59 -0700)]
doc: Don't accidentally create zero-length PDF files

The PDF files are generated at the same time the HTML files are, so
the PDF versions depend on the HTML ones. However, touching the PDF
files is a bad idea.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltos/drivers: Shrink ao_ms5607.c code to fit on micropeak still
Keith Packard [Wed, 22 Aug 2018 07:59:12 +0000 (00:59 -0700)]
altos/drivers: Shrink ao_ms5607.c code to fit on micropeak still

Use some code constructs that make the little AVR processor happier
and save about 16 bytes of memory.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 months agoaltoslib: Reduce debug printf spamming during flashing operation
Keith Packard [Wed, 22 Aug 2018 07:52:21 +0000 (00:52 -0700)]
altoslib: Reduce debug printf spamming during flashing operation

Signed-off-by: Keith Packard <keithp@keithp.com>
13 months agoaltos: don't build fox1ihu by default
Bdale Garbee [Fri, 31 Aug 2018 03:36:18 +0000 (21:36 -0600)]
altos: don't build fox1ihu by default

13 months agoaltosuilib: Provide dialog while waiting for flash target to re-appear
Keith Packard [Thu, 23 Aug 2018 00:44:02 +0000 (17:44 -0700)]
altosuilib: Provide dialog while waiting for flash target to re-appear

On windows, switching to the boot loader can take a long time. Instead
of timing out after a second, show a dialog and let the user cancel
the operation if they get bored of waiting.

Signed-off-by: Keith Packard <keithp@keithp.com>
13 months agoaltosuilib: Include device path in equals test of AltosUSBDevice
Keith Packard [Thu, 23 Aug 2018 00:43:17 +0000 (17:43 -0700)]
altosuilib: Include device path in equals test of AltosUSBDevice

Ensure that multiple AltosFlash devices don't appear the same; they
all use serial number 1.

Signed-off-by: Keith Packard <keithp@keithp.com>
13 months agoaltoslib: Use common constants for flash action messages
Keith Packard [Thu, 23 Aug 2018 00:42:13 +0000 (17:42 -0700)]
altoslib: Use common constants for flash action messages

Place messages in AltosFlashListener instead of using the same strings
in three different places.

Signed-off-by: Keith Packard <keithp@keithp.com>
13 months agoaltosuilib: Don't show radio parameter when reflashing radioless devices
Keith Packard [Wed, 22 Aug 2018 07:58:14 +0000 (00:58 -0700)]
altosuilib: Don't show radio parameter when reflashing radioless devices

Signed-off-by: Keith Packard <keithp@keithp.com>
13 months agoaltosuilib: Show a more useful message when the flash target device is unknown
Keith Packard [Wed, 22 Aug 2018 07:56:25 +0000 (00:56 -0700)]
altosuilib: Show a more useful message when the flash target device is unknown

The flashing code uses the new symbol table to find information in the
existing device; if they don't match at all, there won't be anything
about the target device known. Tell the user this, rather than
displaying mystic information (or crashing).

Signed-off-by: Keith Packard <keithp@keithp.com>
13 months agoaltosuilib: Poll for devices while Select Device dialog is displayed
Keith Packard [Wed, 22 Aug 2018 07:54:55 +0000 (00:54 -0700)]
altosuilib: Poll for devices while Select Device dialog is displayed

Lets the user plug/unplug devices and have the dialog box show the
current set of available devices. Particularly useful on Windows where
it takes a long time after connecting a device for the OS to actually
make it usable.

Signed-off-by: Keith Packard <keithp@keithp.com>
13 months agoaltosuilib: Add 'equals' method to AltosDevice
Keith Packard [Wed, 22 Aug 2018 07:53:46 +0000 (00:53 -0700)]
altosuilib: Add 'equals' method to AltosDevice

Signed-off-by: Keith Packard <keithp@keithp.com>
14 months agoaltos: Switch global 'log' to 'ao_log_data'
Keith Packard [Wed, 15 Aug 2018 22:31:57 +0000 (15:31 -0700)]
altos: Switch global 'log' to 'ao_log_data'

Avoid conflicts with 'log' math function.

Signed-off-by: Keith Packard <keithp@keithp.com>
14 months agoaltos/stmf0: Stop using 'stdin' name as local variable
Keith Packard [Sun, 5 Aug 2018 04:20:56 +0000 (12:20 +0800)]
altos/stmf0: Stop using 'stdin' name as local variable

stdio kinda wants to own this name

Signed-off-by: Keith Packard <keithp@keithp.com>
14 months agoaltos/lpc: Fix stdio wakeup on serial IRQ
Keith Packard [Sun, 5 Aug 2018 04:19:59 +0000 (12:19 +0800)]
altos/lpc: Fix stdio wakeup on serial IRQ

Should just use USE_SERIAL_0_STDIN directly

Signed-off-by: Keith Packard <keithp@keithp.com>
14 months agoaltos: Allow timer interrupt without needing tick count
Keith Packard [Tue, 14 Aug 2018 00:43:13 +0000 (17:43 -0700)]
altos: Allow timer interrupt without needing tick count

This saves a bit of space in the fox1ihu loader which uses the timer
interrupt to poke the watchdog.

Signed-off-by: Keith Packard <keithp@keithp.com>
14 months agoaltos: Remove spurious 'const' from ao_state_names
Keith Packard [Tue, 14 Aug 2018 00:43:57 +0000 (17:43 -0700)]
altos: Remove spurious 'const' from ao_state_names

Current gcc complains about this.

Signed-off-by: Keith Packard <keithp@keithp.com>
14 months agoaltos: Remove spurious ao_mma655x_spi_index variable
Keith Packard [Sun, 5 Aug 2018 04:19:19 +0000 (12:19 +0800)]
altos: Remove spurious ao_mma655x_spi_index variable

This isn't used; was probably included for debugging at some point.

Signed-off-by: Keith Packard <keithp@keithp.com>
14 months agoBump java lib versions to 13
Keith Packard [Sun, 5 Aug 2018 04:32:42 +0000 (12:32 +0800)]
Bump java lib versions to 13

Signed-off-by: Keith Packard <keithp@keithp.com>
14 months agoInclude TeleMega v3.0 firmware with releases
Keith Packard [Mon, 6 Aug 2018 05:15:21 +0000 (13:15 +0800)]
Include TeleMega v3.0 firmware with releases

Signed-off-by: Keith Packard <keithp@keithp.com>
14 months agoBump version to 1.8.6.1
Keith Packard [Sun, 5 Aug 2018 04:28:25 +0000 (12:28 +0800)]
Bump version to 1.8.6.1

Signed-off-by: Keith Packard <keithp@keithp.com>
14 months agocapture updates to Releasing from 1.8.6 release process
Bdale Garbee [Sun, 5 Aug 2018 06:11:01 +0000 (14:11 +0800)]
capture updates to Releasing from 1.8.6 release process

14 months agoUpdate docs for 1.8.6
Keith Packard [Sun, 5 Aug 2018 03:13:23 +0000 (11:13 +0800)]
Update docs for 1.8.6

Signed-off-by: Keith Packard <keithp@keithp.com>
14 months agoaltos: Add separate 'ao_launch_tick'. Use in pyro and lockout.
Keith Packard [Sun, 5 Aug 2018 03:09:34 +0000 (11:09 +0800)]
altos: Add separate 'ao_launch_tick'. Use in pyro and lockout.

Prior to this, there was only ao_boost_tick, which got reset at each
motor burn start. That meant there wasn't any way to measure total
flight time for pyro channels and 'apogee lockout' was based on time
since most recent motor start instead of total flight time.

Now pyro channels and apogee lockout both use total flight time, while
motor burn length still uses time since most recent motor burn start
(as it should).

Docs and UI updated to use 'launch' instead of 'boost' to try and make
the change clear.

Signed-off-by: Keith Packard <keithp@keithp.com>
14 months agoaltos/plottest: Make linewidth bigger
Keith Packard [Sun, 5 Aug 2018 01:03:35 +0000 (09:03 +0800)]
altos/plottest: Make linewidth bigger

1-pixel lines are harsh in 2018

Signed-off-by: Keith Packard <keithp@keithp.com>
14 months agoaltos/stm-demo: Set up for dumping eeprom
Keith Packard [Sun, 5 Aug 2018 00:45:30 +0000 (08:45 +0800)]
altos/stm-demo: Set up for dumping eeprom

This is used to dump an eeprom wired to the stm demo board.

Signed-off-by: Keith Packard <keithp@keithp.com>
14 months agoaltos: Change 'after motor' pyro check to be >= instead of ==
Keith Packard [Sun, 5 Aug 2018 00:44:04 +0000 (08:44 +0800)]
altos: Change 'after motor' pyro check to be >= instead of ==

This makes after motor stay valid even if further motors burn.

Signed-off-by: Keith Packard <keithp@keithp.com>
14 months agoao-tools/ao-dumplog: Dump entire eeprom contents
Keith Packard [Sun, 5 Aug 2018 00:43:06 +0000 (08:43 +0800)]
ao-tools/ao-dumplog: Dump entire eeprom contents

This gets the eeprom size from the device and uses that to dump the
whole thing.

Signed-off-by: Keith Packard <keithp@keithp.com>
15 months agoaltoslib: Make stop_remote delay depend on the data rate
Keith Packard [Thu, 5 Jul 2018 03:25:58 +0000 (20:25 -0700)]
altoslib: Make stop_remote delay depend on the data rate

It takes longer to flush commands at 2400 baud, so wait longer when
disabling remote mode.

Signed-off-by: Keith Packard <keithp@keithp.com>
15 months agoaltos: Fetch current quadrature status at startup time
Keith Packard [Wed, 4 Jul 2018 23:08:31 +0000 (16:08 -0700)]
altos: Fetch current quadrature status at startup time

This avoids having the state appear to change the first time we look
at the device.

Signed-off-by: Keith Packard <keithp@keithp.com>
15 months agoaltos: Make fewer LCO variables public
Keith Packard [Wed, 4 Jul 2018 19:34:38 +0000 (12:34 -0700)]
altos: Make fewer LCO variables public

The lco common code doesn't need to share its internal values with the
world; make most of them static.

Signed-off-by: Keith Packard <keithp@keithp.com>
15 months agoaltos: Make LCO search directly drive pad/box displays
Keith Packard [Wed, 4 Jul 2018 18:58:40 +0000 (11:58 -0700)]
altos: Make LCO search directly drive pad/box displays

Don't use ao_lco_show as that has other logic too.

Signed-off-by: Keith Packard <keithp@keithp.com>
15 months agoaltos: Fix LCO display while searching
Keith Packard [Wed, 4 Jul 2018 18:27:31 +0000 (11:27 -0700)]
altos: Fix LCO display while searching

Use lower level functions to control the display more directly

Signed-off-by: Keith Packard <keithp@keithp.com>
15 months agoaltos: Fix telelcotwo build for new ao_lco_bits.c file
Keith Packard [Wed, 4 Jul 2018 18:18:12 +0000 (11:18 -0700)]
altos: Fix telelcotwo build for new ao_lco_bits.c file

Lots of code motion; shouldn't have any functional changes.

Signed-off-by: Keith Packard <keithp@keithp.com>
15 months agoadd telefireeight-v1.0 to products built by default in src/Makefile
Bdale Garbee [Wed, 4 Jul 2018 18:13:38 +0000 (12:13 -0600)]
add telefireeight-v1.0 to products built by default in src/Makefile

15 months agoaltos: A bit more LCO code sharing
Keith Packard [Tue, 3 Jul 2018 08:06:09 +0000 (01:06 -0700)]
altos: A bit more LCO code sharing

Missed drag race pad toggling in ao_lco_v2.c

Signed-off-by: Keith Packard <keithp@keithp.com>
15 months agoaltos: Build telelco-v2.0 by default
Keith Packard [Tue, 3 Jul 2018 08:01:05 +0000 (01:01 -0700)]
altos: Build telelco-v2.0 by default

Signed-off-by: Keith Packard <keithp@keithp.com>
15 months agoaltos: Share common LCO functions in ao_lco_bits.c
Keith Packard [Tue, 3 Jul 2018 08:00:15 +0000 (01:00 -0700)]
altos: Share common LCO functions in ao_lco_bits.c

Move common code out of ao_lco.c and ao_lco_v2.c into a shared file,
ao_lco_bits.c. Update ao_lco.h to include shared functions.

Signed-off-by: Keith Packard <keithp@keithp.com>
15 months agoaltos/test: Compute and show height error tracker in ao_flight_test
Keith Packard [Mon, 2 Jul 2018 21:21:48 +0000 (14:21 -0700)]
altos/test: Compute and show height error tracker in ao_flight_test

Enable the computation of ao_error_h_sq_avg in ao_flight_test even
when an accelerometer is present to allow review of that data.

Signed-off-by: Keith Packard <keithp@keithp.com>
15 months agoaltosuilib: Split cc1111 vs arm telefire/telemini for flashing
Keith Packard [Mon, 2 Jul 2018 21:20:39 +0000 (14:20 -0700)]
altosuilib: Split cc1111 vs arm telefire/telemini for flashing

Only older telefire and telemini boards had cc1111 processors and need
pair-programming.

Signed-off-by: Keith Packard <keithp@keithp.com>
15 months agoadd a turnon script for TeleLCO v2.0
Bdale Garbee [Sun, 1 Jul 2018 20:50:26 +0000 (14:50 -0600)]
add a turnon script for TeleLCO v2.0

16 months agoaltos/telelco-v2.0: Do all drag race beeping from the beeping thread
Keith Packard [Mon, 18 Jun 2018 17:53:35 +0000 (10:53 -0700)]
altos/telelco-v2.0: Do all drag race beeping from the beeping thread

Instead of starting the beep from the calling thread, just update some
state and poke the beeping thread.

Signed-off-by: Keith Packard <keithp@keithp.com>
16 months agoaltos/ao_pad: Move LED test to the monitor task
Keith Packard [Sun, 17 Jun 2018 19:35:23 +0000 (12:35 -0700)]
altos/ao_pad: Move LED test to the monitor task

It sets the LEDs, so it's best to not start doing that until we've
tested them.

Signed-off-by: Keith Packard <keithp@keithp.com>
16 months agoaltos/ao_pad: Turn on all LEDs for a moment at power up
Keith Packard [Sun, 17 Jun 2018 19:30:09 +0000 (12:30 -0700)]
altos/ao_pad: Turn on all LEDs for a moment at power up

Allow validation of all LED connections.

Signed-off-by: Keith Packard <keithp@keithp.com>
16 months agoaltos/ao_pad: Use AO_LED_TYPE for computing active LEDs.
Keith Packard [Sun, 17 Jun 2018 19:29:36 +0000 (12:29 -0700)]
altos/ao_pad: Use AO_LED_TYPE for computing active LEDs.

instead of uint8_t

Signed-off-by: Keith Packard <keithp@keithp.com>
16 months agoaltos/stm: Let products override AO_LED_TYPE for stm processors
Keith Packard [Sun, 17 Jun 2018 19:28:51 +0000 (12:28 -0700)]
altos/stm: Let products override AO_LED_TYPE for stm processors

No need requiring it to be uint16_t

Signed-off-by: Keith Packard <keithp@keithp.com>
16 months agoBump version to 1.8.6
Keith Packard [Sun, 17 Jun 2018 08:36:00 +0000 (01:36 -0700)]
Bump version to 1.8.6

Prepare for release.

Signed-off-by: Keith Packard <keithp@keithp.com>
16 months agoaltos/telelco-v2.0: Fix AO_ADC_DUMP
Keith Packard [Sun, 17 Jun 2018 08:20:01 +0000 (01:20 -0700)]
altos/telelco-v2.0: Fix AO_ADC_DUMP

Was printing p.v_batt instead of (p)->v_batt. I don't know why the
former even worked.

Signed-off-by: Keith Packard <keithp@keithp.com>
16 months agoaltos/telelco-v0.2-cc1200: Add build for NAR hacked TeleLCO v0.2 board
Keith Packard [Sun, 17 Jun 2018 06:50:11 +0000 (23:50 -0700)]
altos/telelco-v0.2-cc1200: Add build for NAR hacked TeleLCO v0.2 board

This has the CC1120 replaced with a CC1200, but with 32MHz xtals
instead of 40MHz on the radio chip.

Signed-off-by: Keith Packard <keithp@keithp.com>
16 months agoaltos/driver: Improve quadrature debouncing for mechanical encoders
Keith Packard [Sun, 17 Jun 2018 06:51:26 +0000 (23:51 -0700)]
altos/driver: Improve quadrature debouncing for mechanical encoders

Track state of encoder better and only bump values when the full
motion is detected (all four states).

Signed-off-by: Keith Packard <keithp@keithp.com>
16 months agoaltos/telelco-v0: Test display, show batt voltage at boot
Keith Packard [Sun, 17 Jun 2018 07:17:29 +0000 (00:17 -0700)]
altos/telelco-v0: Test display, show batt voltage at boot

Just like telelco v2

Signed-off-by: Keith Packard <keithp@keithp.com>
16 months agoao-bringup: Find dfu-util in $PATH for chaoskey
Keith Packard [Sun, 17 Jun 2018 07:19:37 +0000 (00:19 -0700)]
ao-bringup: Find dfu-util in $PATH for chaoskey

In case it's not in /usr/bin

Signed-off-by: Keith Packard <keithp@keithp.com>
16 months agoaltos/stm: Define ADC channels for TEMP and V_REF
Keith Packard [Sun, 17 Jun 2018 06:47:42 +0000 (23:47 -0700)]
altos/stm: Define ADC channels for TEMP and V_REF

These are fixed at 16 and 17.

Signed-off-by: Keith Packard <keithp@keithp.com>
16 months agoaltos/stm: Remove unused ADC names from ao_adc_single_stm.c
Keith Packard [Sun, 17 Jun 2018 06:47:15 +0000 (23:47 -0700)]
altos/stm: Remove unused ADC names from ao_adc_single_stm.c

Signed-off-by: Keith Packard <keithp@keithp.com>
16 months agoaltos/telelco: Remove STATIC_TEST code from stand-alone LCO boxes
Keith Packard [Fri, 1 Jun 2018 05:45:49 +0000 (22:45 -0700)]
altos/telelco: Remove STATIC_TEST code from stand-alone LCO boxes

This command conflicts with the 'debug' command in these devices and
so wasn't usable anyways.

Signed-off-by: Keith Packard <keithp@keithp.com>
16 months agoaltos/telelco-v2.0: Test displays at power on
Keith Packard [Fri, 1 Jun 2018 05:42:13 +0000 (22:42 -0700)]
altos/telelco-v2.0: Test displays at power on

At boot, light up all LEDS and LCD segments for a second to let the
user verify that things are working correctly.

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