fw/altos
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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

5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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

5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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

5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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

5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years agoaltos/telefire*: Do voltage tests in decivolts instead of ADC units
Keith Packard [Fri, 1 Jun 2018 05:39:45 +0000 (22:39 -0700)]
altos/telefire*: Do voltage tests in decivolts instead of ADC units

This requires that each pad device specify the ADC reference voltage
and all relevant voltage divider resistor values explicitly so that
the ADC values can be converted to decivolts and compared with one
another. This should be easier to understand in the future when
reading the code.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/telefireeight-v1.0: Fix ADC definitions
Keith Packard [Thu, 31 May 2018 23:24:33 +0000 (16:24 -0700)]
altos/telefireeight-v1.0: Fix ADC definitions

Was missing all of the GPIO configuration bits, which probably meant
the ADCs were returning garbage values.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltoslib: Revert field name changes for accel cal values
Keith Packard [Wed, 30 May 2018 18:38:24 +0000 (11:38 -0700)]
altoslib: Revert field name changes for accel cal values

These names get written in the JSON part of all .eeprom files, so we
can't change the names or the values won't be read and written correctly.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/telelco-v2.0: Set HAS_ADC_SINGLE to enable HSI timer
Keith Packard [Tue, 29 May 2018 02:19:43 +0000 (19:19 -0700)]
altos/telelco-v2.0: Set HAS_ADC_SINGLE to enable HSI timer

The ADC unit requires the HSI timer to run, so make sure it's enabled
for this device.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/stm: Enable HSI timer when HAS_ADC_SINGLE is set
Keith Packard [Tue, 29 May 2018 02:18:48 +0000 (19:18 -0700)]
altos/stm: Enable HSI timer when HAS_ADC_SINGLE is set

The ADC unit always uses the HSI timer.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/telelco-v2.0: Display local batt voltage at startup
Keith Packard [Mon, 28 May 2018 23:10:51 +0000 (16:10 -0700)]
altos/telelco-v2.0: Display local batt voltage at startup

Show the battery voltage for a second at startup.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/stm: Add polling ADC sampler API
Keith Packard [Mon, 28 May 2018 23:09:19 +0000 (16:09 -0700)]
altos/stm: Add polling ADC sampler API

This just fetches ADC values on demand instead of loading them
periodically into a ring buffer from the timer interrupt.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/telelco-v2.0: Change drag race selected/no-continutity pattern
Keith Packard [Mon, 28 May 2018 22:12:26 +0000 (15:12 -0700)]
altos/telelco-v2.0: Change drag race selected/no-continutity pattern

Make it turn on at the same time as the pads with continuity, but turn
off sooner

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/telelco-v2.0: Add debug output for pad voltage display
Keith Packard [Mon, 28 May 2018 22:07:06 +0000 (15:07 -0700)]
altos/telelco-v2.0: Add debug output for pad voltage display

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/telelco-v2.0: A bit fancier with the drag-mode LED show
Keith Packard [Mon, 28 May 2018 21:54:47 +0000 (14:54 -0700)]
altos/telelco-v2.0: A bit fancier with the drag-mode LED show

Continutity leds now show whether the pad is included in the drag race
*and* the continutity using four different patterns:

Drag select & igniter present: long on, short off
Drag select & igniter missing: short on, long off
Not select & igniter present: solid on
Not select & igniter missing: solid off

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/telelco-v2.0: Fix button names and pin mappings. Add drag LED.
Keith Packard [Mon, 28 May 2018 21:41:51 +0000 (14:41 -0700)]
altos/telelco-v2.0: Fix button names and pin mappings. Add drag LED.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/telelco-v2.0: Mixed up the select_button pin (is E0, was set to E13)
Keith Packard [Mon, 28 May 2018 21:35:18 +0000 (14:35 -0700)]
altos/telelco-v2.0: Mixed up the select_button pin (is E0, was set to E13)

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/telelco-v2.0: Only look at drag select presses, not releases
Keith Packard [Mon, 28 May 2018 21:26:47 +0000 (14:26 -0700)]
altos/telelco-v2.0: Only look at drag select presses, not releases

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/telelco-v2.0: Use single-step quadrature code
Keith Packard [Mon, 28 May 2018 21:26:12 +0000 (14:26 -0700)]
altos/telelco-v2.0: Use single-step quadrature code

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/driver: Add support for one-step-per-click quadrature encoder
Keith Packard [Mon, 28 May 2018 21:15:34 +0000 (14:15 -0700)]
altos/driver: Add support for one-step-per-click quadrature encoder

The mechanical encoders go through all four steps per click while the
optical ones have a single step per click. Support both kinds.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/telelco-v2.0: Reduce quadrature debounce time
Keith Packard [Mon, 28 May 2018 20:08:33 +0000 (13:08 -0700)]
altos/telelco-v2.0: Reduce quadrature debounce time

The optical encoders shouldn't bounce at all; let's try a minimal value.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/drivers: Make quadrature debounce longer by default. Fix state tracking
Keith Packard [Mon, 28 May 2018 20:07:06 +0000 (13:07 -0700)]
altos/drivers: Make quadrature debounce longer by default. Fix state tracking

This increases the default debounce time for quadrature encoders to
30ms, which cleans up the mechanical encoders on TeleLCO v0.2. Also
change state tracking to explicitly check for expected state values to
avoid mis-triggering.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/telelco-v2.0: Only switch encoder mode on push, not release
Keith Packard [Mon, 28 May 2018 19:06:41 +0000 (12:06 -0700)]
altos/telelco-v2.0: Only switch encoder mode on push, not release

Was not checking event value.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/ao_button.c: Support up to 16 buttons
Keith Packard [Mon, 28 May 2018 18:23:03 +0000 (11:23 -0700)]
altos/ao_button.c: Support up to 16 buttons

TeleLCO v2.0 has more than 4

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/telelco-v2: Change select button to alternate box/pad mode
Keith Packard [Mon, 28 May 2018 18:12:36 +0000 (11:12 -0700)]
altos/telelco-v2: Change select button to alternate box/pad mode

Instead of a three-way, just make the select button two-way and have
the arming switch disable it.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos: Add TeleFireEight v1.0 product
Keith Packard [Tue, 22 May 2018 05:36:35 +0000 (22:36 -0700)]
altos: Add TeleFireEight v1.0 product

Eight pyro channel version of the TeleFire boards.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/drivers: Pads with multi-port firing and pad selector DIP switch
Keith Packard [Tue, 22 May 2018 05:32:38 +0000 (22:32 -0700)]
altos/drivers: Pads with multi-port firing and pad selector DIP switch

TeleFire 8 scrambles GPIOs to make layout cleaner, placing the 8
firing outputs across two GPIO ports.

We're also adding an 8-unit selector for box number so that boards can
be re-configured in the field. These override any ROM-configuration
value; you can select the rom value by setting all switches to 'off'.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/stm: Add per-LED port/pin mode in LED code
Keith Packard [Thu, 17 May 2018 05:03:25 +0000 (22:03 -0700)]
altos/stm: Add per-LED port/pin mode in LED code

If you've got a complicated LED pin arrangement, you can ask for each
one to be configured separately, instead of using groups in a couple
of GPIO registers. The code isn't as efficient this way, but at least
it's easy to read.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos: Add TeleLCO v2.0 product
Keith Packard [Thu, 17 May 2018 05:02:11 +0000 (22:02 -0700)]
altos: Add TeleLCO v2.0 product

New LCO design with a single rotary knob and lots more buttons.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/vidtime: Check for value change in normal code, not irq
Keith Packard [Thu, 17 May 2018 05:05:26 +0000 (22:05 -0700)]
altos/vidtime: Check for value change in normal code, not irq

This makes sure each value change is reported to the user.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos: add 'vidtime', a simple brightness monitor
Keith Packard [Mon, 7 May 2018 18:26:42 +0000 (11:26 -0700)]
altos: add 'vidtime', a simple brightness monitor

This is a testing tool for video refresh tracking. It uses the mpusb
v3.0 hardware and monitors the phototransistor value, sending 0 or 1
to the USB port when the value changes.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoMerge branch 'mpusb'
Keith Packard [Mon, 7 May 2018 16:53:52 +0000 (09:53 -0700)]
Merge branch 'mpusb'

5 years agoaltos/mpusb-v3.0: Make it compile again
Keith Packard [Mon, 7 May 2018 16:43:27 +0000 (09:43 -0700)]
altos/mpusb-v3.0: Make it compile again

A few things have changed since this code was written.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/stmf0: leave ao_power_gpio names undefined without power management
Keith Packard [Mon, 7 May 2018 16:42:28 +0000 (09:42 -0700)]
altos/stmf0: leave ao_power_gpio names undefined without power management

Should make it more obvious at compile time that you've done something wrong.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos: Add µPusb v3.0 project
Keith Packard [Wed, 20 Jan 2016 08:00:07 +0000 (00:00 -0800)]
altos: Add µPusb v3.0 project

This replaces the ft230 with a stm32f04, saving a bit of BOM
and giving us control over the firmware.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agodoc: Update pyro channel info to reflect UI changes
Keith Packard [Mon, 7 May 2018 15:58:21 +0000 (08:58 -0700)]
doc: Update pyro channel info to reflect UI changes

Use the new naming in the UI. Add lots more comments about how things work.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos/test: Replace state name with 10* state value in test log. Fix raw speed
Keith Packard [Mon, 7 May 2018 15:56:32 +0000 (08:56 -0700)]
altos/test: Replace state name with 10* state value in test log. Fix raw speed

Using a state value means we can plot state changes along with the
rest of the graph. Raw speed (simple integrated acceleration) was
busted; mostly needing to skip the first accel sample.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 years agoaltos: Eliminate height requirement for coast detect
Keith Packard [Mon, 7 May 2018 15:51:36 +0000 (08:51 -0700)]
altos: Eliminate height requirement for coast detect

We had required a minimum altitude of 100m to transition from boost to
coast. With small motors in a heavy multi-staged rocket, this can fail
to detect coast in time to light the second motor.

Also, this would fail to deploy recovery systems if the flight failed
before reaching 100m.

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