Keith Packard [Wed, 28 Mar 2012 07:38:37 +0000 (00:38 -0700)]
altos: Make sure config values are loaded in 'c s' command
ao_config_get may not have been called when ao_config_show is invoked
by the user, so make sure the config values are loaded before showing
uninitialized data.
Keith Packard [Wed, 28 Mar 2012 05:02:13 +0000 (22:02 -0700)]
altosui: Make 'monitor idle' work with older TeleMetrum firmware (trac #28)
Older TM firmware did not have the 'done' line at the end of the GPS
report, rather it would just stop after showing the Flags value. Check
the TM version and stop looking for GPS data when the Flags line appears.
Keith Packard [Wed, 28 Mar 2012 04:48:43 +0000 (21:48 -0700)]
altosui: Catch attempt to set radio frequency to 0.0 -- use default
Monitor idle was setting the frequency to 0, which takes a while with
the new native radio frequency setting code. Don't do that, instead
pull out the preferred frequency for that, as is done in other places
where a frequency of 0.0 is used.
Keith Packard [Wed, 28 Mar 2012 04:13:31 +0000 (21:13 -0700)]
altosui: Find actual landing time when computing stats (trac #23)
Look for the last time the height went from >10m to <2m from the
nominal landing altitude and use that as the landing time when
computing things like main descent speed, time under main etc.
Keith Packard [Wed, 28 Mar 2012 01:24:51 +0000 (18:24 -0700)]
altosui: Change flight data saving UI to separate download/delete selections
First pop up a dialog to select flights for download. Download
them. Then, after that, pop up a *new* dialog to select flights for
delete. Offer to delete all of the downloaded flights by default. Then
delete the flights.
Keith Packard [Wed, 28 Sep 2011 06:50:43 +0000 (23:50 -0700)]
altos: Require callsign match in packet code
Ignore packets with mismatching callsigns to avoid accidental
connections between devices controlled by different stations.
As a special case, if the device is configured with the default
callsign (N0CALL), then let anyone connect. This allows configuration
of new devices without needing to change the ground station callsign.
Keith Packard [Sun, 13 Nov 2011 02:44:36 +0000 (18:44 -0800)]
altos: Handle internal and external telem monitoring requests
Record separate internal vs external monitoring state, allowing
both to happen at the same time, and when either is turned off, the
other keeps working.
This also adds disable/enable so that other radio users can
temporarily take over the radio; monitoring will resume when the other
radio user is finished.
Keith Packard [Sun, 13 Nov 2011 02:37:53 +0000 (18:37 -0800)]
altos: Check pdata+xdata memory usage during build
The sdcc linker doesn't check the sum of pdata+xdata memory usage, it
only ensures that xdata itself is small enough. This doesn't keep
xdata below the end of usable ram on the cc1111 though (0xfe000).
Fix up the check-stack program to also make sure all of xdata fits in
available memory.
Keith Packard [Sat, 12 Nov 2011 06:30:17 +0000 (22:30 -0800)]
altos: Make ao_xmem funcs require __xdata void * instead of casting
Having an explicit cast in the ao_xmem wrapper macros caused the
compiler to generate garbage values for pdata addresses, making the
upper byte 0x00 instead of the required 0xf0. Removing the
casts from the ao_xmem macros exposed this problem, so a new
PDATA_TO_XDATA macros was added, along with a CODE_TO_XDATA macro
which serve to cast pointers, with suitable address modifications, so
that things work again.
Keith Packard [Thu, 27 Oct 2011 07:49:23 +0000 (00:49 -0700)]
altosui: Only update GPS data when new GPS information arrives
Track which telemetry packets are actually producing new GPS
information and only update the GPS average position and count of
stable GPS reports with new GPS info, instead of on every telemetry packet.
Keith Packard [Thu, 27 Oct 2011 07:35:35 +0000 (00:35 -0700)]
altos: Fix distance/bearing computations. Deal with large values
Lots of little math errors dealing with large distances; easily tested
as the GPS currently reports lat 24 lon 121, which is a long ways from
Portland.
Now reports distances in km when large, otherwise in m.
Keith Packard [Tue, 11 Oct 2011 22:03:04 +0000 (16:03 -0600)]
altos/avr: SPI mutex is now held by the caller, not the SPI driver
SPI transactions generally require a read followed by a write, with
the chip select held the whole time. As a result, the SPI bus must be
held across multiple transactions. To make this reliable, the caller
must hold the SPI mutex, instead of the underlying SPI driver.
Keith Packard [Sun, 9 Oct 2011 16:21:56 +0000 (10:21 -0600)]
altos: Respond to telemetry rate changes immediately
Instead of waiting for the previous telemetry interval to expire,
immediately switch to the new telemetry rate. This will provide
more telemetry data early in the boost.
Keith Packard [Sun, 9 Oct 2011 04:19:52 +0000 (22:19 -0600)]
altos: Improve TM v1.0 apogee estimate
v1.0 boards have noisy accelerometer data caused by interactions
between RF transmission and the accelerometer measurements; this noise
generates a negative bias in the accelerometer readings. The net
effect is that the estimated speed is lower than the actual speed,
causing early an apogee estimate.
By increasing the sigma value for accelerometer data, the kalman
filter 'trusts' the acceleration data less, putting more weight on the
barometer data. This causes the estimated time of apogee to be closer
to the correct value.
This reduces the response to changes in acceleration.
This new value is applied solely to TeleMetrum v1.0 boards. v1.1
boards correct for this error, and hence can use the correct sigma
value for the accelerometer.
Keith Packard [Sat, 8 Oct 2011 17:51:05 +0000 (11:51 -0600)]
altos: Ignore ejection bumps when doing boost re-detect
An ejection charge looks an awful lot like an extra (really small)
motor burn. Ignore them by averaging the acceleration during
fast/coast using a /64 exponential decay filter.
Keith Packard [Wed, 28 Sep 2011 04:06:54 +0000 (21:06 -0700)]
altos: TM: Don't turn on packet slave mode until idle/invalid state
Leave the packet link disabled until we've checked the
accelerometer. That way, we cannot accidentally get to idle mode when
the rocket is on the rail.
Keith Packard [Mon, 26 Sep 2011 18:50:28 +0000 (11:50 -0700)]
altos: Delay reboot by a second to avoid re-entering idle mode
TM and Tm go into idle mode if they receive a packet after boot
time. When tebooting the device over the packet link, the packet
master would be (rapidly) polling the device for additional data and
so the device would invariably receive a packet during bootup and go
into idle mode again.
Delay the reboot by a second to give the controller time to disable
the master end of the packet link.