summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* altos/lisp: Make let distinct from let*Keith Packard2017-12-01
| | | | | | | | let is supposed to define the values all at once, evaluating the initializers in the enclosing context. let* defines the new names and then initializes them one at a time. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: return from unmatched cond is #f, not nilKeith Packard2017-12-01
| | | | | | | Fix the return value when we fall off the end of a cond expression to be #f Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Fix pairp builtinKeith Packard2017-12-01
| | | | | | Pairs are non-nil cons values; add an explicit check for nil here Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Add quasiquoteKeith Packard2017-12-01
| | | | | | | This adds read support for quasiquote syntax, and then adds a quasiquote implementation in lisp Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Rename progn to beginKeith Packard2017-11-25
| | | | | | Match scheme name. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/test: Update to build altos lisp test appKeith Packard2017-11-19
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Add floatsKeith Packard2017-11-19
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Fix some scheme compat issuesKeith Packard2017-11-18
| | | | | | | | | | flush -> flush-output nth -> list-ref (oh, and add list-tail) add let* (same as let for now) write control chars in octal make hanoi example work Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Add 'big' ints -- 24 bits wideKeith Packard2017-11-18
| | | | | | | With the default ints being only 14 bits, having a larger type with more precision seems useful. This is not exposed to the application. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cortexelf-v1: Make lisp compile againKeith Packard2017-11-17
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/test: Add jiffy funcs to lisp testKeith Packard2017-11-17
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Finish first pass through r7rsKeith Packard2017-11-17
| | | | | | | | | | * print -> write, patom -> display * Add read-char, write-char * Add exit, current-jiffy, current-second, jiffies-per-second * Add for-each and string-for-each * Avoid duplicate builtins with different atoms Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Add applyKeith Packard2017-11-17
| | | | | | And all of the library routines that use it, map, string-map and friends. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Character consts. String and assoc builtins.Keith Packard2017-11-17
| | | | | | Also add back escaped characters in strings. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Generate built-in lambda atoms for const creationKeith Packard2017-11-17
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/test: More lisp test Makefile fixesKeith Packard2017-11-16
| | | | | | Depend on ao_lisp_const.h Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Lots more scheme bitsKeith Packard2017-11-16
| | | | | | | | * Arithmetic functions and tests * append, reverse and list-tail * set-car! and set-cdr! Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/test: Get lisp test building using Makefile-incKeith Packard2017-11-16
| | | | | | Instead of re-defining all of the lisp sources and headers Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: More schemismsKeith Packard2017-11-16
| | | | | | | | | | Add 'if'. setq -> set!, but doesn't define new variables def -> define Add pair? and list? Add eq? and eqv? as aliases for = Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Add 'else' sematics to condKeith Packard2017-11-16
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Add scheme-style bools (#t and #f)Keith Packard2017-11-16
| | | | | | Cond and while compare against #f, just like scheme says to. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Add non-cons cdr supportKeith Packard2017-11-16
| | | | | | | The cdr of a cons can be any value; add support for lexing and printing them. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Fix new GCC warningsKeith Packard2017-11-11
| | | | | | | | * Duplicate 'const' in test code. * Mis-formatted loop in kf_rem_pio2 * Unused 'one' in sf_cos Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Fix inverted test for corrupt flight logKeith Packard2017-11-11
| | | | | | Was reporting correct flight log as corrupted. Oops. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/test: Adapt flight test to int16_t flight number typeKeith Packard2017-11-11
| | | | | | | Flight numbers are now limited to 32767 to allow for negative values for corrupted slots. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Add AO_EXTI_MODE_PULL_NONEKeith Packard2017-11-11
| | | | | | This is clearer than using '0'. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: whitespace cleanup in ao_adc_stm.cKeith Packard2017-11-11
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Share common logging code. Deal with corrupt initial flight recordsKeith Packard2017-10-28
| | | | | | | | | | | Move common logging APIs from per-format files into ao_log.c. Then, change that code to check the first log record in a slot (containing the flight number) to see if it's invalid and deal with it. That involves not re-using that slot, and allowing it to be erased. Corrupted log blocks are reported with a negative flight number. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Define AO_LOG_FORMAT in */ao_pins.h. Use in ao_cmd.cKeith Packard2017-10-22
| | | | | | | Instead of having a global variable define the log format, use a macro instead to save data space. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Remove cross-block storage I/O on cc1111Keith Packard2017-10-22
| | | | | | | | We don't ever need to be able to do storage read/write across chunks of flash on the old cc1111 products, so remove the loops that support it to save space. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add MPU9250 support to self test and dataKeith Packard2017-10-12
| | | | | | The remaining hooks to make the MPU9250 work in flight. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add MPU9250 driver (accel/gyro only for now)Keith Packard2017-10-12
| | | | | | | This is almost an exact copy of the MPU6000 driver, just a few minor register changes. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Stop storing pyro fired status in config blockKeith Packard2017-10-08
| | | | | | | | | | | We already have the fired status saved in the ao_pyro_fired variable, so just use that to detect whether a channel has already been fired. Fixes possible cases where the pyro config data gets written back to eeprom with the fired bit set, which then inhibits the channel during flight. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow pyro config name to end with newline, not just space/tabKeith Packard2017-10-02
| | | | | | | | A pyro config like 'Descending' has no value associated. When it is at the end of the line, allow a newline to terminate the name instead of just a space. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/telegps-v2.0: Enable USB connect monitoringKeith Packard2017-09-18
| | | | | | | Disable radios when plugged in to USB to save power and avoid being noisy. Signed-off-by: Keith Packard <keithp@keithp.com>
* Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altosBdale Garbee2017-09-18
|\
| * test/ao_flight_test: Show recorded pyro firingKeith Packard2017-09-18
| | | | | | | | | | | | Can compare with computed values. Signed-off-by: Keith Packard <keithp@keithp.com>
* | production TeleGPS v2.0 use a 16Mhz crystal for the SOCBdale Garbee2017-09-18
|/
* publish support for TeleGPS v2.0Bdale Garbee2017-09-17
|
* altos/test: Handle new eeprom file format. Give up on telem files.Keith Packard2017-09-12
| | | | | | | Parse eeprom config using libjson-c, then read the hex values into a giant blob. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Fix debug printf in ao_pyro for state >=Keith Packard2017-09-12
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* chaoskey: Wait for input data to stabilize before using itKeith Packard2017-09-12
| | | | | | | The ADC data takes a while to start working after power on; wait for the range of input values to look reasonable before using the data. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Don't compute filtered average of height error when HAS_ACCELKeith Packard2017-08-28
| | | | | | | | We only use this for baro-only devices to avoid firing drogue charges at mach transitions; we trust the combination of accel+baro to do the right thing when available. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/test: Fake baro data for flight 12 serial 2093Keith Packard2017-08-27
| | | | | | | | This flight had a baro spike due to an accidental drogue charge firing but is otherwise quite useful when testing for various mach delay effects, so fake out the data during that spike. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/test: Integrate raw accel to provide speed for comparisonKeith Packard2017-08-27
| | | | | | | | This can provide a useful visualization of the 'true' vs 'kalman' speed value, as the kalman is necessarily delayed due to the model assuming constant acceleration. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/test: telemetrum baro data is inverted before being written to eepromKeith Packard2017-08-27
| | | | | | No need for the test code to invert it during replay Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Don't eliminate baro above mach speed, just trust it lessKeith Packard2017-08-27
| | | | | | | | | | | | | | | | | | | | | | | | Instead of completely eliminating the baro sensor above mach speed, just derate it a bit so that the accel will dominate for speed computation and keep the device from false-triggering across mach transitions. When we completely ignored the baro sensor above mach, and the flight spent considerable time in that speed range, then the estimated height could be far from the real value. When the estimated speed dropped back down and the baro values were brought back into the computation, then the resulting rapid shift in estimated speed could trigger accidental apogee detection. By mixing in a bit of baro data even above mach, we keep the estimated height closer to the baro value and prevent this error, at least in flights measured so far. The flight known to have this problem is: 2015-09-26-serial-2093-flight-0012.eeprom Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Eliminate separate height error filter for accelerometer devicesKeith Packard2017-08-27
| | | | | | | We don't use the error value in flight for those models anyways; it's only useful on baro-only hardware. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Perform time comparisons using 16-bit arithmetic to handle wrapKeith Packard2017-08-27
| | | | | | | Subtracting two 16-bit unsigned values to perform time comparisons yields mystic results unless we carefully cast that to int16_t. Signed-off-by: Keith Packard <keithp@keithp.com>
* Merge remote-tracking branch 'origin/master'Keith Packard2017-08-11
|\