summaryrefslogtreecommitdiff
path: root/src/ao.h
Commit message (Collapse)AuthorAge
* altos: Bounds check Skytraq GPS tracking data arrayKeith Packard2010-09-01
| | | | | | | | | | | | | 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>
* altos: prepare for sdcc 2.9.1Keith Packard2010-08-27
| | | | | | | 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>
* altos: mark gps date written only after it gets into eepromKeith Packard2010-08-26
| | | | | | | | 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>
* altosui: write USB serial number string while flashingKeith Packard2010-08-24
| | | | | | | | 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>
* altos: Place rom config variables in fixed locationKeith Packard2010-08-23
| | | | | | | | | | | | | | | 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>
* altos: add callsign to packet mode, increase payload to 64 bytesKeith Packard2010-08-07
| | | | | | | Untested, but it 'should' work. Need to add callsign setting to packet mode users. Signed-off-by: Keith Packard <keithp@keithp.com>
* Make ao_log_data re-entrant as it is used for both sensor and GPS logsKeith Packard2010-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Telemetry code was mis-computing RSSIKeith Packard2010-07-14
| | | | | | | 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>
* Add special code for USB panic's.Keith Packard2010-06-16
| | | | | | | | 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>
* Tasks may move in task structure as a result of ao_exitKeith Packard2010-04-06
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* Fix up LED colors for each product.Keith Packard2010-02-27
| | | | | | | | Different products assign different color LEDs to the two available LED drivers (P1_0, P1_1). Make the LED color pin assignments per-product (in ao_pins.h), then deal with not always having a green LED. Signed-off-by: Keith Packard <keithp@keithp.com>
* Change altos build process to support per-product compile-time changesKeith Packard2010-02-20
| | | | | | | | This creates per-product subdirectories and recompiles everything for each product, allowing per-product compile-time changes for things like peripheral pin assignments and attached serial devices. Signed-off-by: Keith Packard <keithp@keithp.com>
* Log GPS data on pad after boost detect.Keith Packard2010-02-13
| | | | | | | | | This wakes up the two GPS reporting tasks and gets them to report out any existing GPS data to the log file. To make sure the timestamps in that GPS data are accurate, this also records GPS time on receipt of the GPS data instead of when that is logged. Signed-off-by: Keith Packard <keithp@keithp.com>
* Force idle mode by shorting the SPI clock to ground at boot time.Keith Packard2010-01-09
| | | | | | | | This allows you to override the flight mode detection code in case the accelerometer calibration is broken somehow. Hold the SPI clock shoted to ground until the LED comes on, then remove it. Signed-off-by: Keith Packard <keithp@keithp.com>
* Add AT45DBxx1D driverKeith Packard2010-01-09
| | | | | | | This driver supports the AT45DB011D through AT45DB321D DataFlash parts as found in TeleMetrum v0.2 Signed-off-by: Keith Packard <keithp@keithp.com>
* Use ao_radio_get/ao_radio_put in packet code.Keith Packard2009-12-19
| | | | | | | | The ao_radio_get function both acquires the mutex *and* configures the radio channel and frequency. Failing to use this in the packet code would leave the radio frequency unconfigured. Signed-off-by: Keith Packard <keithp@keithp.com>
* Re-order config values. Change frequency to calKeith Packard2009-12-05
| | | | | | | Place more often used values at top, and consistently call the radio value 'calibration' instead of 'frequency'. Signed-off-by: Keith Packard <keithp@keithp.com>
* Add radio calibration configuration.Keith Packard2009-12-04
| | | | | | | | | The crystal we use is only good for 20ppm, which generates a fairly significant error bounds at our RF frequency. This commit adds a configuration variable that sets the RF frequency control variable so that the output frequency can be adjusted. Signed-off-by: Keith Packard <keithp@keithp.com>
* Make ao_cmd_decimal produce both 32 and 16 bit values.Keith Packard2009-12-04
| | | | | | | ao_cmd_lex_u32 is produced in addition to ao_cmd_lex_i so that functions can easily read 32-bit values from the command line. Signed-off-by: Keith Packard <keithp@keithp.com>
* Stop using SiRF state info.Keith Packard2009-11-15
| | | | | | | | With the switch to the skytraq GPS unit, we don't have the same level of detail in the GPS stream, so stop reporting that in the telemetry stream, in the UI and writing it to eeprom. Signed-off-by: Keith Packard <keithp@keithp.com>
* Add date to GPS data, captured from GPRMC packet.Keith Packard2009-11-15
| | | | | | | Pull the date out of the GPS stream and send it over the telemetry link and write it to the eeprom. Signed-off-by: Keith Packard <keithp@keithp.com>
* Add flight number to telemetry stream.Keith Packard2009-11-15
| | | | | | | | This makes it easier to tie the telemetry and eeprom files together as they're now both labeled with serial and flight numbers, which should be unique. Signed-off-by: Keith Packard <keithp@keithp.com>
* Add reboot command.Keith Packard2009-11-05
| | | | | | This resets the processor using the watchdog timer. Signed-off-by: Keith Packard <keithp@keithp.com>
* Move ao_match_word from ao_ignite.c to ao_cmd.cKeith Packard2009-11-05
| | | | | | This is a generally useful command line utility. Signed-off-by: Keith Packard <keithp@keithp.com>
* Pass accel calibration over telemetry stream. Telemetry data format change.Keith Packard2009-11-03
| | | | | | | | | | | This allows the ground station to convert the accelerometer sensor values into acceleration and speed data. This requires a new telemetry data structure, and so TeleMetrum and TeleDongle units must be updated synchronously. ao-view will parse either telemetry stream, and the serial format from TeleDongle now has a version number to allow for future changes. Signed-off-by: Keith Packard <keithp@keithp.com>
* Add two-point accelerometer calibration.Keith Packard2009-11-02
| | | | | | | Calibration now uses two values, one upside right and the other upside down instead of a single horizontal value. This allows the use of other accelerometers and compensates for variations in the divider circuit to provide more accurate data.
* Add ao_usb_pollchar to ao.hKeith Packard2009-11-02
|
* Enable packet-based communcation to command processorKeith Packard2009-11-01
| | | | | | | This splits the packet code into master/slave halves and hooks the slave side up to the getchar/putchar/flush logic in ao_stdio.c Signed-off-by: Keith Packard <keithp@keithp.com>
* Poke master to speed up packet rate when things are busyKeith Packard2009-10-31
|
* Send SYN packet to set sequence numbersKeith Packard2009-10-30
|
* Remove reason from ao_dma_abortKeith Packard2009-10-30
|
* Add ao_alarmKeith Packard2009-10-30
|
* Wait for TX to finish sending dataKeith Packard2009-10-30
|
* Initial packet bits. Just testing transmissionKeith Packard2009-10-30
|
* Add ao_wake_task and ao_exitKeith Packard2009-10-16
| | | | | | | ao_wake_task signals a specific task to wake up. ao_exit terminates the current task. Signed-off-by: Keith Packard <keithp@keithp.com>
* Merge branch 'master' into skytraqKeith Packard2009-10-10
|\
| * Add apogee igniter delay.Keith Packard2009-10-10
| | | | | | | | | | | | | | Provide for a delay after apogee before the drogue charge is fired. This allows TM to be used as a back-up altimeter. Signed-off-by: Keith Packard <keithp@keithp.com>
* | Add support for the SkyTraq GPS unitKeith Packard2009-10-09
|/ | | | | | This is a build-time option selected by hacking the Makefile at present. Signed-off-by: Keith Packard <keithp@keithp.com>
* Make RDF beacon only run on pad and after landing.Keith Packard2009-09-04
| | | | | | | | | | | | It's pretty much impossible to RDF the rocket during flight, and it interferes with the telemetry data stream. Leave it enabled on the pad so that radios can be tested, and then re-enable it once the rocket has landed. This patch also turns the rdf 'on' time into a parameter so it can be changed, and then sets that parameter to 500ms, once every 5 seconds. Signed-off-by: Keith Packard <keithp@keithp.com>
* Add back the RDF tone generatorKeith Packard2009-09-04
| | | | | | | | | Tracking the rocket on the ground may be easier using tones than using the digital data stream, so we'll try that and see what we think. This reverts commit 3a3bfd471a868d546d83cdc431b53c8f5208edb9. Signed-off-by: Keith Packard <keithp@keithp.com>
* Make the ao_log_record structures 8 bytes again.Keith Packard2009-09-02
| | | | | | | | | When the GPS signal strength data was added, the structure was accidentally extended to 9 bytes, making all log records 9 bytes long. While not a serious problem, this left log records spanning across eeprom block boundaries, which seems like a bad plan. Signed-off-by: Keith Packard <keithp@keithp.com>
* Handle GPS satellite tracking dataKeith Packard2009-08-18
| | | | | | | | SiRF message #4 includes signal strength and GPS engine state for each of the satellites being tracked. This data is now parsed and sent to eeprom and the radio. Signed-off-by: Keith Packard <keithp@keithp.com>
* Add AO_GPS_RUNNING state.Keith Packard2009-07-17
| | | | | | | | This tracks whether the GPS receiver has ever sent a valid report to the flight computer, allowing the user to tell whether the GPS receiver is working at all. Signed-off-by: Keith Packard <keithp@keithp.com>
* Use 57600 baud for GPS. Clean up gps init.Keith Packard2009-07-17
| | | | | | | | | Assume GPS is either in 4800 NMEA or 57600 SiRF mode, send just the sequence to get from 4800 NMEA to 5760 SiRF. Also, eliminate threads from the gps test program. Signed-off-by: Keith Packard <keithp@keithp.com>
* Add GPS speed and error data to telemetry and aoviewKeith Packard2009-06-29
| | | | | | | Having switched to the SiRF binary GPS format, the velocity and error data can now be displayed. Signed-off-by: Keith Packard <keithp@keithp.com>
* Convert GPS to SiRF binary protocol.Keith Packard2009-06-29
| | | | | | | | | This switches the GPS unit from NMEA to SiRF protocol at startup and then parses the binary data. The binary data uses a different encoding of lat/lon than the NMEA strings, and so the telemetry and eeprom data formats change with this switch. Signed-off-by: Keith Packard <keithp@keithp.com>
* Fix clock initialization to not try to use 32kHz xtal on P2_3/P2_4Keith Packard2009-06-17
| | | | | | | | | None of our boards have a 32kHz xtal oscillator, instead we use those pins (on Telemetrum) for the deployment firing circuits. The old clock initialization code was switching from the 32kHz RC oscillator to the 32kHz crystal and overriding our use of those pins. Signed-off-by: Keith Packard <keithp@keithp.com>
* Rename state apogee -> coastKeith Packard2009-06-14
|
* rename states. launchpad -> pad, coast -> fastKeith Packard2009-06-14
|
* Use autotools, move altos to src subdirKeith Packard2009-06-04
Signed-off-by: Keith Packard <keithp@keithp.com>