fw/altos
11 years agoaltoslib: Make AltosConfigData parse all of the config data
Keith Packard [Fri, 7 Dec 2012 01:08:39 +0000 (17:08 -0800)]
altoslib: Make AltosConfigData parse all of the config data

It was missing quite a few. This also speeds up parsing of config from
TeleScience, TeleBT and TeleTerra by not listing flight info on those
products (where it doesn't make sense).

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltoslib: Make AltosMs5607 capable of parsing ms5607 info lines
Keith Packard [Fri, 7 Dec 2012 01:07:25 +0000 (17:07 -0800)]
altoslib: Make AltosMs5607 capable of parsing ms5607 info lines

This moves the parsing from AltosMs5607Query

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Change 'flight-number' to 'current-flight'
Keith Packard [Fri, 7 Dec 2012 01:06:17 +0000 (17:06 -0800)]
altos: Change 'flight-number' to 'current-flight'

Avoids ambiguity with stored flight info, which starts lines with 'flight'.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Shrink 'ao_version' by calling printf fewer times
Keith Packard [Fri, 7 Dec 2012 00:29:36 +0000 (16:29 -0800)]
altos: Shrink 'ao_version' by calling printf fewer times

Each printf call costs quite a bit of code space on the cc1111, so
instead of making multiple short calls, make one longer one.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Send APRS packets even during ascent
Keith Packard [Thu, 6 Dec 2012 18:30:46 +0000 (10:30 -0800)]
altos: Send APRS packets even during ascent

If you're using APRS, presumably you want to watch the rocket going up too.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Allow telemetry, rdf and APRS to be individually controlled
Keith Packard [Thu, 6 Dec 2012 18:28:14 +0000 (10:28 -0800)]
altos: Allow telemetry, rdf and APRS to be individually controlled

But, only when APRS is available so that TeleMetrum and TeleMini don't
change behaviour

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Hook up APRS to telemetry loop
Keith Packard [Thu, 6 Dec 2012 18:23:39 +0000 (10:23 -0800)]
altos: Hook up APRS to telemetry loop

Send APRS packet once every 2 seconds

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Hook APRS up to the radio
Keith Packard [Thu, 6 Dec 2012 18:12:11 +0000 (10:12 -0800)]
altos: Hook APRS up to the radio

This adds an arbitrary-length packet writing function to the radio
code.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Prepare APRS for use within altos itself
Keith Packard [Thu, 6 Dec 2012 07:39:47 +0000 (23:39 -0800)]
altos: Prepare APRS for use within altos itself

Make all variables static, const-ify constants, change the public
name of the single entry point.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Start restructuring APRS code to create and send packets
Keith Packard [Thu, 6 Dec 2012 06:23:46 +0000 (22:23 -0800)]
altos: Start restructuring APRS code to create and send packets

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Remove a bunch of time bits from the APRS code
Keith Packard [Thu, 6 Dec 2012 05:37:47 +0000 (21:37 -0800)]
altos: Remove a bunch of time bits from the APRS code

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Remove APRS sine-wave table
Keith Packard [Thu, 6 Dec 2012 05:34:05 +0000 (21:34 -0800)]
altos: Remove APRS sine-wave table

We're generating a lovely square wave, which appears to be decoded
just fine thankyouverymuch.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: More APRS trimming
Keith Packard [Thu, 6 Dec 2012 05:25:29 +0000 (21:25 -0800)]
altos: More APRS trimming

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Remove more unused APRS code
Keith Packard [Thu, 6 Dec 2012 05:22:55 +0000 (21:22 -0800)]
altos: Remove more unused APRS code

Getting down to a reasonable amount of code.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Reduce printf calls in APRS packet generation
Keith Packard [Thu, 6 Dec 2012 05:13:37 +0000 (21:13 -0800)]
altos: Reduce printf calls in APRS packet generation

Merge all of the data into a single printf call

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Strip out everything but the basic position reporting from APRS
Keith Packard [Thu, 6 Dec 2012 05:08:19 +0000 (21:08 -0800)]
altos: Strip out everything but the basic position reporting from APRS

Any useful data will be sent over the digital link; APRS is strictly
for position tracking

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoSigned-off-by: Keith Packard <keithp@keithp.com>
Keith Packard [Thu, 6 Dec 2012 05:01:59 +0000 (21:01 -0800)]
Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Switch APRS to standard position reporting form

Stop using NMEA sentences for position

11 years agoaltos: Add missing ao_aprs.h file
Keith Packard [Thu, 6 Dec 2012 04:11:35 +0000 (20:11 -0800)]
altos: Add missing ao_aprs.h file

This has defines for the planned APRS interface

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Generate all of the APRS messages
Keith Packard [Thu, 6 Dec 2012 04:10:54 +0000 (20:10 -0800)]
altos: Generate all of the APRS messages

Note that two of them are in NMEA form, which some receivers appear
not to parse

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Add test scaffolding for APRS
Keith Packard [Thu, 6 Dec 2012 03:44:09 +0000 (19:44 -0800)]
altos: Add test scaffolding for APRS

This moves some test code out of ao_aprs.c and into ao_aprs_test.c,
and then adds Makefile fragments to compile and run the resulting
program, creating a wav file as output

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Make aprs code output encoded packets to stdout
Keith Packard [Thu, 6 Dec 2012 03:30:27 +0000 (19:30 -0800)]
altos: Make aprs code output encoded packets to stdout

This generates a .wav file containing a single APRS packet. This has
been tested and appears to be successfully decoded by an APRS receiver.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Add Pico Beacon code as ao_aprs.c
Keith Packard [Wed, 5 Dec 2012 17:59:16 +0000 (09:59 -0800)]
altos: Add Pico Beacon code as ao_aprs.c

Pico Beacon hooks a GPS to an AD9954 DDS radio chip with a PIC. It
directly synthesizes the necessary AX.25 packets to do APRS
reporting. We're going to appropriate the code for use in Mega Metrum
to (optionally) broadcast APRS packets.

http://ad7zj.net/kd7lmo/aprsbeacon_code.html

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

11 years agoaltos: Break out GPS speed resetting sequence
Keith Packard [Tue, 4 Dec 2012 17:45:01 +0000 (09:45 -0800)]
altos: Break out GPS speed resetting sequence

To set the GPS speed, we delay for 1/2 sec, change speed, then delay
for another 1/2 sec.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: shrink ao_companion_status by merging printf calls
Keith Packard [Tue, 4 Dec 2012 17:43:56 +0000 (09:43 -0800)]
altos: shrink ao_companion_status by merging printf calls

Multiple printf calls are longer than one big one, so merge these
together to save some code space

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoAnother ao-mega addition which shouldn't be here
Keith Packard [Tue, 4 Dec 2012 16:48:05 +0000 (08:48 -0800)]
Another ao-mega addition which shouldn't be here

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoao-tools. Oops, let 'ao-mega' slip into build.
Keith Packard [Tue, 4 Dec 2012 09:34:03 +0000 (01:34 -0800)]
ao-tools. Oops, let 'ao-mega' slip into build.

This is a tool to parse ao-mega eeprom files; not sure it'll be that
useful, and it's certainly not usable *yet*.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoao-sky-flash: Clean up debug printfs a bit
Keith Packard [Tue, 4 Dec 2012 09:30:39 +0000 (01:30 -0800)]
ao-sky-flash: Clean up debug printfs a bit

This makes debugging output a bit cleaner

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Make skytraq reflashing code try both 9600 and 4800 baud
Keith Packard [Sat, 1 Dec 2012 04:51:47 +0000 (20:51 -0800)]
altos: Make skytraq reflashing code try both 9600 and 4800 baud

This lets it communicate with the ROM code which boots at 4800 baud
instead of 9600 baud.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoao-tools: Add ao-sky-flash to update GPS firmware
Keith Packard [Sat, 1 Dec 2012 01:36:40 +0000 (17:36 -0800)]
ao-tools: Add ao-sky-flash to update GPS firmware

This uses a new feature of AltOS to directly connect the GPS chip to
the USB link to reprogram the former.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Add support for reflashing skytraq GPS chips
Keith Packard [Sat, 1 Dec 2012 00:10:43 +0000 (16:10 -0800)]
altos: Add support for reflashing skytraq GPS chips

This simply switches the skytraq port to 115200 baud and then
essentially connects it directly to the USB port by forwarding bytes
in both directions.

Once started, the only way out is to reboot the board.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Expose GPS serial fifo on MegaMetrum
Keith Packard [Sat, 1 Dec 2012 00:08:41 +0000 (16:08 -0800)]
altos: Expose GPS serial fifo on MegaMetrum

Necessary for direct access by the GPS reflashing code

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Add ao_task_minimize_latency to reduce IRQ delays
Keith Packard [Sat, 1 Dec 2012 00:05:19 +0000 (16:05 -0800)]
altos: Add ao_task_minimize_latency to reduce IRQ delays

When set, this causes the task switching code to avoid blocking IRQs
while looking for an idle task as that can increase IRQ latencies
enough to drop characters at 115200 baud on the cc1111. Note that this
*also* eliminates the ability to use low power modes as we cannot know
at any point whether some interrupt has come along and woken a task.

Has no effect when using task queues as those require IRQs to be
blocked while looking at the queue. Shouldn't be a problem there
though as the check for no running tasks is very cheap.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Use ao_xmemcpy in ao_log_telem.c
Keith Packard [Sat, 1 Dec 2012 00:04:24 +0000 (16:04 -0800)]
altos: Use ao_xmemcpy in ao_log_telem.c

This eliminates the libc generic version in TeleTerra

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Add support for 115200 baud serial rates
Keith Packard [Sat, 1 Dec 2012 00:03:45 +0000 (16:03 -0800)]
altos: Add support for 115200 baud serial rates

Necessary for flashing skytraq chips

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Make stdio 8-bit clean by making pollchar return int
Keith Packard [Sat, 1 Dec 2012 00:01:07 +0000 (16:01 -0800)]
altos: Make stdio 8-bit clean by making pollchar return int

We were stealing one value (0xff) in the return value from pollchar to
indicate 'not ready yet'. Instead of doing that, use the integer value
-1 and have pollchar return an int instead of a char. That
necessitated cleaning a few other bits to make sure that 0xff wouldn't
get promoted to -1 on accident.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Share cc1111 reset/debug-start code
Keith Packard [Fri, 30 Nov 2012 23:10:59 +0000 (15:10 -0800)]
altos: Share cc1111 reset/debug-start code

These sequences are very similar, differing only in whether the dbg
clock line is toggled while holding reset low for a while.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Shrink cc1111/ao_dbg.c a bit
Keith Packard [Fri, 30 Nov 2012 23:05:31 +0000 (15:05 -0800)]
altos: Shrink cc1111/ao_dbg.c a bit

Share code for osequence of ao_dbg_long_delay(); ao_dbg_send_bits()

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Share getnibble function
Keith Packard [Fri, 30 Nov 2012 23:04:21 +0000 (15:04 -0800)]
altos: Share getnibble function

Two implementations of the same function, one in cc1111/ao_dbg.c and
the other in core/ao_send_packet.c.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Make TeleBalloon v1.1 build again
Keith Packard [Fri, 30 Nov 2012 04:36:51 +0000 (20:36 -0800)]
altos: Make TeleBalloon v1.1 build again

This is untested, but at least it builds now

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoMerge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Bdale Garbee [Tue, 20 Nov 2012 19:37:38 +0000 (12:37 -0700)]
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos

11 years agolet upstream version rule, don't force use of Debian version in firmware
Bdale Garbee [Tue, 20 Nov 2012 19:36:26 +0000 (12:36 -0700)]
let upstream version rule, don't force use of Debian version in firmware

11 years agoaltos: Slow down micropeak report timing
Keith Packard [Sun, 18 Nov 2012 18:36:17 +0000 (10:36 -0800)]
altos: Slow down micropeak report timing

This makes reading the LED a lot easier.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: micropeak LED is orange now, not blue
Keith Packard [Sun, 18 Nov 2012 18:35:39 +0000 (10:35 -0800)]
altos: micropeak LED is orange now, not blue

Change the names around to match

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agodoc: Minor updates to the micropeak docs
Keith Packard [Sun, 18 Nov 2012 18:20:52 +0000 (10:20 -0800)]
doc: Minor updates to the micropeak docs

Mention light issue in quick start guide. Update run-time estimate to
40 hours (measured over 44 hours)

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Clean everything, even if we don't have compilers
Keith Packard [Sun, 18 Nov 2012 18:15:14 +0000 (10:15 -0800)]
altos: Clean everything, even if we don't have compilers

This ensures that stale bits aren't left if PATH isn't set right when
'make clean' is called.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltoslib: Reset telem tracking state when switching altimeters
Keith Packard [Sun, 18 Nov 2012 18:13:49 +0000 (10:13 -0800)]
altoslib: Reset telem tracking state when switching altimeters

This discards any local state when the new telem packet has a
different serial number

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltoslib: Allow flight number to be zero
Keith Packard [Sun, 18 Nov 2012 18:10:29 +0000 (10:10 -0800)]
altoslib: Allow flight number to be zero

It's zero when there's no storage space on the device. Instead of
waiting for non-zero flight number, wait for the seen_flight bit to be
set in the telem tracking state

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltoslib: MegaMetrum data telem packets have sensor data, not flight no
Keith Packard [Sun, 18 Nov 2012 18:08:38 +0000 (10:08 -0800)]
altoslib: MegaMetrum data telem packets have sensor data, not flight no

Setting the seen_flight bit without a flight number leads to bogus
file names

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: Make Tm recovery mode set RF cal and callsign too
Keith Packard [Sun, 18 Nov 2012 17:50:54 +0000 (09:50 -0800)]
altos: Make Tm recovery mode set RF cal and callsign too

This lets us connect to Tm even if someone messes up the RF
calibration or callsign info

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltos: fix cc1120 radio test - state wasn't made static
Keith Packard [Sun, 18 Nov 2012 16:46:31 +0000 (08:46 -0800)]
altos: fix cc1120 radio test - state wasn't made static

so whether the radio got turned on was random.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoaltoslib: Add (disabled) conversion for MS5611
Keith Packard [Sun, 18 Nov 2012 01:34:01 +0000 (17:34 -0800)]
altoslib: Add (disabled) conversion for MS5611

In case we actually end up shipping an MS5611-based board at some
point, it will be nice to have the java code on hand

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agodoc: Start updating AltOS documentation for multi-arch
Keith Packard [Sat, 17 Nov 2012 06:19:17 +0000 (22:19 -0800)]
doc: Start updating AltOS documentation for multi-arch

Now that AltOS supports many processors, start updating the
documentation to match.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years 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>
11 years 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>
11 years 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>
11 years 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>
11 years 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>
11 years 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>
11 years 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>
11 years 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>
11 years 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>
11 years 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>
11 years 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>
11 years 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>
11 years 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>
11 years 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>
11 years 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'

11 years 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>
11 years 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>
11 years 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>
11 years 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>
11 years 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>
11 years 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>
11 years 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>
11 years 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>
11 years 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>
11 years 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'

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

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

11 years 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>
11 years 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'

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