summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Add version numbers to released files. Set version to 0.7.1Keith Packard2010-09-04
| | | | | | | | 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>
* altos: add some SDCDB config filesKeith Packard2010-09-04
|
* 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: Windows sends USB Out packets of 0 length. Ack them.Keith Packard2010-08-30
| | | | | | | | 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>
* altos: shut down packet mode cleanlyKeith Packard2010-08-29
| | | | | | | | | | | | 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>
* altos: Abort radio harder when terminating packet mode.Keith Packard2010-08-29
| | | | | | | | 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>
* altos: flush pending output when terminating packet modeKeith Packard2010-08-29
| | | | | | | 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>
* 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>
* altos: print GPS state flags in GPS 'g' commandKeith Packard2010-08-26
| | | | | | Having the GPS state information can help with GPS debugging. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: always rebuild ao_product.c to track git versionKeith Packard2010-08-26
| | | | | | | | | | | 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>
* 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: Define USB product ID in per-product Makefile.defs fileKeith Packard2010-08-21
| | | | | | | 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>
* 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>
* When the EP0 IN buffer is full, don't panic, just skip sending anotherKeith Packard2010-07-26
| | | | | | | | | | 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>
* Switch DBG pins to GPIO when using any debug commands. Reboot to restore.Keith Packard2010-07-14
| | | | | | | | | | | | 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>
* 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>
* Abort any in-progress radio operation when changing radio channelKeith Packard2010-06-21
| | | | | | | | | 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>
* 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>
* Revert "Merge remote branch 'remotes/origin/fix-reset'"Bdale Garbee2010-05-06
| | | | | | | This reverts commit 314d27a73c903fef2968dabac3d5313573713460, reversing changes made to fa77db2ffd8a749c93767db5a6311131e00473ae. For whatever reason, this is utterly not doing the right things today!
* Don't change dbg clock while changing reset_n. Use 20ms everywhereKeith Packard2010-05-05
| | | | | | | | This changes the reset code to be more conservative about changing things at the same time, and also sets all timings to 20ms to make debugging with the scope easier. Signed-off-by: Keith Packard <keithp@keithp.com>
* Use ao_delay to sleep for 2 seconds instead of trying ao_sleepKeith Packard2010-05-05
| | | | | ao_sleep doesn't delay for a specified time interval as much as one might want it to.
* Fix all stdio reading functions to be __criticalKeith Packard2010-05-05
| | | | | | | Oh, right SDCC has '__critical' to mark sections of code that need to run with interrupts disabled; no need to use EA = 0 and EA = 1. Signed-off-by: Keith Packard <keithp@keithp.com>
* Disable interrupts while reading from stdinKeith Packard2010-05-05
| | | | | | | | | | | | With multiple input source support, there is a lag between asking a device if it has data and then waiting for more data to appear. If an interrupt signalling additional input arrives in this interval, we'll go to sleep with input available. This patch uses a big hammer by just disabling interrupts for the whole process. Signed-off-by: Keith Packard <keithp@keithp.com>
* Revert "Add optional 's' command to packet slave to enable/disable slave mode"Keith Packard2010-05-04
| | | | | | | This reverts commit e7dc7fab787df63a4de72c8450e94092eb04d7db. This patch didn't work, and magically appears to break flashing TM from TD.
* Add optional 's' command to packet slave to enable/disable slave modeKeith Packard2010-04-22
| | | | | | | This option has been selected for teledongle so that you can use slave mode and hook two teledongles together over the RF link. Signed-off-by: Keith Packard <keithp@keithp.com>
* Increase reset switch time to 100msKeith Packard2010-04-10
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* Only have the slave return a packet if it received one.Keith Packard2010-04-09
| | | | | | | | | | | When the receive is aborted to switch modes, it's important to not immediately re-acquire the radio and try to send a packet as the aborting thread won't know to kick the receiver again. This prevents the 'C' command from locking up as it tries to stop the packet slave before turning on the transmitter. Signed-off-by: Keith Packard <keithp@keithp.com>
* When changing RESET line, delay 20msKeith Packard2010-04-08
| | | | | | | | | | | The GPS data sheet suggests a 1uF cap on the reset line to ensure it is held low long enough for the power supply to come up to voltage. TM v1.0 loads a 0.001uF cap there, but in case that isn't large enough, it could be replaced with the larger one. This change makes sure that even with that larger value, the debugging link will be able to reset the target. 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>
* Switch TeleMetrum from v0.2 to v1.0Keith Packard2010-04-04
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* Don't abort the radio when enabling telemetry monitoringKeith Packard2010-04-04
| | | | | | | If telemetry monitoring is already on, then there isn't any point, and if it's not on, then presumably there isn't any radio work to abort. Signed-off-by: Keith Packard <keithp@keithp.com>
* Make ao_radio_idle keep trying to get the radio to idle.Keith Packard2010-04-04
| | | | | | | Attempting to abort a radio operation could lead to a hang if the user of the radio jumped in and started using it again before the task attempting to abort woke up. This change just keeps smacking the radio until the radio goes idle long enough to detect it.
* 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>
* Eliminate deadlock when writing config from radio linkKeith Packard2010-02-27
| | | | | | | | | | | | Writing the 'Saved\r\n' string would fill the packet buffer and cause a flush to occur, which would need to wait for the radio link to receive and transmit a packet. The radio link always re-fetches the radio channel number when lighting up the radio, so it need to look in the config space. If the config mutex was held by the config writing process while the radio was trying to get the channel number, then we'd get a deadlock. Signed-off-by: Keith Packard <keithp@keithp.com>
* Leave .ihx files in the build directory too - easier to debug that wayKeith Packard2010-02-27
| | | | | | | sdcdb wants the .ihx and .cdb files in the same directory, so humor it by copying the .ihx files to the src directory instead of moving them. Signed-off-by: Keith Packard <keithp@keithp.com>
* Must install .map files for ao-load to workKeith Packard2010-02-20
| | | | | | | ao-load uses the .map files to rewrite the serial number and other config parameters into the program flash. Signed-off-by: Keith Packard <keithp@keithp.com>
* Add back stack size checking to altos linking phaseKeith Packard2010-02-20
| | | | | | | This verifies that the stack start specified during the compile will work with the resulting program Signed-off-by: Keith Packard <keithp@keithp.com>
* Quiet make output.Keith Packard2010-02-20
| | | | | | | This borrows ideas from the notmuch project to reduce the command line clutter seen when compiling or linking stuff. Signed-off-by: Keith Packard <keithp@keithp.com>
* Update .gitignore filesKeith Packard2010-02-20
|
* 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>
* Change barometer conversion code to shrink conversion tableKeith Packard2010-02-20
|
* 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>
* Missing ao_mutex_put in gps_dumpKeith Packard2010-02-11
|
* Switch to using internal cc1111 temperature sensorKeith Packard2010-01-10
| | | | | | | | v0.2 has no temperature sensor, and several of the v0.1 boards didn't get a temperature sensor loaded. Use the internal temperature sensor on the cc1111 in all cases instead. 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 simple gps dump command 'g'Keith Packard2010-01-09
| | | | | | | This just dumps out the data in a very simple format to verify the GPS receiver. Signed-off-by: Keith Packard <keithp@keithp.com>
* Remove flash debugging printfsKeith Packard2010-01-09
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>