| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
| |
When the 3.3V and 5V values shift relative to each other (usually due
to changes in power consumption), the measured acceleration will
appear to shift. This patch converts the 3.3V referenced acceleration
value into a 5V referenced acceleration, eliminating this error.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This stores the address of the desired sample in a local variable and
then fetches through that. Saves quite a few instructions.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This places the 5v reference samples in an array parallel to the basic
ADC values. It doesn't do anything with the values, just stores them.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
Instead of having everyone wait on the raw ADC ring, have the flight
code wait on that and have everyone else wait for the flight code to
finish looking at the data and move its pointer forwards.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
Use the provided ground acceleration average to set the two
accelerometer calibration values so that the flight code will
detect pad/idle mode correctly.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
Slightly reduces code space.
Uncalibrated accelerometer now enters invalid state as well.
Signed-off-by: Mike Beattie <mike@ethernal.org>
|
|
|
|
|
|
|
| |
The flight test harness needs to expose every function used by the
flight code in some form, and this macro is about to become used.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Chose invalid flight mode instead of idle to give user feedback.
Signed-off-by: Mike Beattie <mike@ethernal.org>
|
|
|
|
|
|
|
| |
When detecting flight or idle mode, this should indicate
that accel cal values are out of whack.
Signed-off-by: Mike Beattie <mike@ethernal.org>
|
|
|
|
|
|
|
| |
This lets us use a simple shift instead of a divide, saving a huge
amount of code space.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
| |
Splitting this into several smaller functions appears to make SDCC
generate better code.
|
|
|
|
|
|
|
| |
When the log storage is full, make sure any pending writes are flushed
out so that the last bit isn't lost.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
What a terrible mistake! The flight computer serial numbers were
recorded in only 8 bits, so serial numbers > 255 would get truncated.
There's really no fix other than bumping the field to 16 bits and
reflashing every TM and TD on the planet. Very unfortunate.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
Zero is not a valid flight number, and ao_log_flight uses that to
indicate 'no flight in this slot'. Check the user-provided input for
zero before looking through the slots.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Just a silly off-by-one error when printing out the data received from flash.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
These are all initialized in the ao_flight_drogue state transition.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Presumably left-over debugging code.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Reports special tone along with the continuity checks.
Reports flight 0 in telemetry.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Make sure the amount of memory requested for a single log isn't more
than is available on the device.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This reduces the size of data and code needed to report the
flight states
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
It was getting called only when *failing* to erase a flight (oops),
secondly, it wasn't getting written because ao_storage_flush wasn't
getting called.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
makes them compatible with the 'e' command.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
No need to read the block to be erased before erasing it.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This adds the logging support for dealing with multiple flights
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This parameter will permit available storage to be split into multiple
separate flight logs.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
code easier to write
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Remove premature optimization to avoid re-scanning the flight logs for
the best empty entry.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This reworks the storage API so that you erase blocks and then store
data to them so that the M25P80 driver will work.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This supports flash chips that require larger erase blocks.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This removes the config-specific APIs and exposes global variables for
the available storage space, block size and config storage location.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Just fixing the type of a local variable holding a character
passed from the packet link to usb.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This just clones the v1.0 build; changes will be added on top of this.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
For TM with the companion connector, the SPI bus will be shared among
multiple devices. Split out the existing SPI code into a common
driver, with the SPI bus protected by a mutex.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Waking up a task waiting on some random object is a bad idea. Fix
the waiters to look for suitable signalling.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of aborting the DMA and radio operation and expecting that to
be handled reasonably by the radio receiving task, rewrite things so
that the abort function just wakes the receiving task while that
terminates the DMA and cleans up the radio.
This eliminates all kinds of nasty bugs dealing with radio abort
smashing the radio registers at the wrong time, or interrupting a
radio transmission.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This reverts commit 54468e5dc567aaac5c5c20e921859b7cec28bb88.
With this patch in place, TD could not be placed in 'packet' mode.
|
|
|
|
|
|
|
|
| |
Remember whether the radio test mode is on or off and don't try to do
either of them twice to prevent the mutex from being acquired or
released twice.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
We only want to abort pending radio reception to release the radio for
other use, or to change the radio channel. Let radio transmission
proceed. This fixes a problem with using packet mode to configure the
radio channel; if the packet transmission is aborted, the TM ends up
wedged.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
The 'status' variable used to hold a reported status value from the
igniter after firing, but we ignore that now.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
Many igniters don't go open when fired, so there's no way
to know if they worked. Assume they did as a failed igniter is
unlikely to do anything when fired again anyways.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This lets the user turn the radio on/off and then invoke other commands.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
Instead of using git revision counts for version numbers, use explicit
versions numbers configured in the configure.ac file. Expose published
files with version numbers.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Missing GPS serial data could cause the tracking array reset to
get skipped, causing the array to be overrun, smashing critical data
beyond the array.
This was detected using the 'altosui' flash command to program a
device from TM. Hitting the USB that hard caused TM to crash with a
mutex error (3 beeps) after the ao_gps_task structure was overwritten
with zeros.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
This was an untested case as no other operating system sents 0-length
out packets (they're not necessary). The correct response is to ACK
them by clearing the OUTPKT_RDY bit so that another packet can be sent.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of constantly bashing the packet master thread, let it shut
itself down in an orderly fashion. It will shut down fairly quickly as
all of the activities in that thread are bounded. Otherwise, the
master packet thread might leave mutexes locked and all sorts of other
horrors.
Tested on Linux and Mac OS X and shown to be reliable.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
Make sure the master radio tasks don't get stuck waiting for an
incoming packet again by aborting the radio each time we poke the
tasks.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Just in case the last command sent hasn't been transmitted, hang
around for up to a second waiting for the data to get across the link.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
A few minor language changes -- non-standard keywords are now prefixed
with __, such as 'at', 'interrupt', 'naked'.
Signed-off-by: Keith Packard <keithp@keithp.com>
|