summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* altos: ensure erase mark is written when erasing flightsKeith Packard2011-01-07
| | | | | | | | 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>
* altos: report flight log offsets in hex block numbers instead of bytesKeith Packard2011-01-07
| | | | | | makes them compatible with the 'e' command. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: white space fixKeith Packard2011-01-07
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Speed up at45 and 25lc erase speedsKeith Packard2011-01-07
| | | | | | No need to read the block to be erased before erasing it. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: support storage of multiple flights.Keith Packard2011-01-07
| | | | | | This adds the logging support for dealing with multiple flights Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add configuration parameter for maximum flight log sizeKeith Packard2011-01-07
| | | | | | | This parameter will permit available storage to be split into multiple separate flight logs. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Mark end of available flight list with 'done' to make the UIKeith Packard2011-01-06
| | | | | | code easier to write Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Rip out 'optimization' in ao_log_scanKeith Packard2011-01-06
| | | | | | | Remove premature optimization to avoid re-scanning the flight logs for the best empty entry. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Move common storage code to ao_storage.c. Add M25P80 driverKeith Packard2011-01-06
| | | | | | | 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>
* altos: Require manual flight erasing.Keith Packard2011-01-06
| | | | | | This supports flash chips that require larger erase blocks. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Simplify storage APIKeith Packard2011-01-06
| | | | | | | 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>
* altos: packet and usb i/o routines use 'char', not 'uint8_t'Keith Packard2011-01-06
| | | | | | | 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>
* altos: Add telemetrum-v1.1 directoryKeith Packard2010-12-22
| | | | | | This just clones the v1.0 build; changes will be added on top of this. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Split out SPI driver.Keith Packard2010-12-22
| | | | | | | | 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>
* altos: eliminate ao_wake_taskKeith Packard2010-12-22
| | | | | | | 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>
* altos: clean up radio abort paths. Share radio code.Keith Packard2010-12-22
| | | | | | | | | | | | | 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>
* Revert "altos: Don't abort radio transmissions with ao_radio_abort"Keith Packard2010-11-25
| | | | | | This reverts commit 54468e5dc567aaac5c5c20e921859b7cec28bb88. With this patch in place, TD could not be placed in 'packet' mode.
* altos: Make radio test command careful with the radio mutex.Keith Packard2010-11-23
| | | | | | | | 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>
* altos: Don't abort radio transmissions with ao_radio_abortKeith Packard2010-11-23
| | | | | | | | | | 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>
* altos: remove unused variable from ao_igniterKeith Packard2010-11-23
| | | | | | | 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>
* altos: assume igniter worked.Keith Packard2010-11-22
| | | | | | | | 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>
* altos: Add on/off modes to 'C' commandKeith Packard2010-11-21
| | | | | | This lets the user turn the radio on/off and then invoke other commands. Signed-off-by: Keith Packard <keithp@keithp.com>
* 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>