| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
Data logging doesn't start until boost detect occurs. As the GPS date
is only logged once, if that happens before logging is written to the
flash, then the GPS date will never get saved.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Having the GPS state information can help with GPS debugging.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The git version is built into ao_product.c and saved in eeprom log
files, providing useful diagnostics about the firmware revision used
for each flight. However, if ao_product.c isn't recompiled, then the
updated version won't be included. Force recompilation of this file
each time make is run to ensure that the final output contains an
updated version number.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
USB serial number is encoded in UCS2 as a part of the string
descriptors. Place those right after the other rom config bits so that
altosui can find it. altosui is changed to write the serial number there.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The device serial number and radio calibration values are stored in
flash, mostly so that TeleDongle gets them saved.
Placing them in well-known locations (starting at 0xa0) makes it
possible to find the previous configuration and to re-write it
easily, without requiring the .map file.
altosui doesn't have the .map file parsing code, so it relies upon
this new technique. As a benefit, it reads the old values from the
device before reprogramming it.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This allows Win7 to tell which kind of device is connected purely by
USB id as it doesn't expose the USB product ID string to user space.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Untested, but it 'should' work. Need to add callsign setting to packet
mode users.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because ao_log_data is called from two different threads, failing to
make it re-entrant would cause the 'log' pointer parameter to get
overwritten if another thread asked to log data while the eeprom was
busy writing out a block.
This would cause the second thread to re-writing data from the first
thread's address, but without re-checksumming the data as the checksum
is computed before the log mutex is taken.
The bug can be seen by log blocks with invalid checksums.
Here's what happens with the ao_gps_tracking_report and ao_log threads:
ao_gps_tracking_report ao_log
Writes a bunch of records
*blocks* in the eeprom flush
sets ao_log_data 'log' to global 'log'
computes checksum for 'log' block
*blocks* on ao_log_mutex
Wakes up
sets ao_log_data 'log' to 'gps_log'
writes remaining records
'gps_log' is left with svid = 0
*blocks* on ao_gps_tracking_data
writes data, reading from
the current ao_log_data 'log'
pointer which points at 'gps_log'
Making ao_log_data re-entrant fixes this by ensuring that the 'ao_log'
thread has its own copy of the ao_log_data 'log' parameter.
I made this function take an __xdata restricted pointer so that it
could be passed in the dptr register instead of needing to go on the stack.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
If the host doesn't pull the IN packet out of EP0 before sending
another SETUP command along, the IN buffer will still be busy when we
try to reply to the SETUP command. While I don't quite understand why
this would ever happen, there's no need to panic about it, just drop
the reply packet on the floor.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
If you want to use TeleMetrum as a debug dongle, you need to flip the
three pins used to talk to the remote debug port from SPI mode to GPIO
mode.
This patch doesn't provide any way to get back to SPI mode, so you'll
have to reboot the TeleMetrum to write out config parameters or log
flight data after using any debug commands.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
The RSSI data from the hardware reports in 1/2 dBm increments, and so
must be divided to report plain RSSI numbers.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
| |
In monitor mode, the current receive operation must be aborted so that
the radio channel change can take effect without receiving a
telemetry packet on the old channel. Aborting any in-progress radio
operation will make sure that happens.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
The USB system may panic if the hardware isn't ready for IN data when
the driver thinks it should be. This adds a special panic code to make
figuring this out easier.
Signed-off-by: Keith Packard <keithp@keithp.com>
|