summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* altos/lisp: Switch to scheme formal syntax for varargsKeith Packard2017-12-03
| | | | | | | | | | Scheme uses bare symbols to indicate a varargs parameter; any bare (i.e., not wrapped in a cons cell) parameter will get the 'rest' of the parameter list. This works for lambdas, nlambdas and macros. As a result, the 'lexpr' form has been removed as it is equivalent to a lambda with a varargs formal. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Fix stash usage across frame allocationKeith Packard2017-12-03
| | | | | | | Must un-stash before allocation failure check. Use frame_stash instead of poly_stash for frames. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Check only cdr base type when moving cons cellsKeith Packard2017-12-03
| | | | | | | | The cdr may have moved, so we can't look at the target object type. Fortunately, the base type encoded in the reference itself is sufficient to check for a non-cons cdr. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Split out read debug, add memory validationKeith Packard2017-12-03
| | | | | | | | Split read debug into a separate #define to reduce debug noise Add some memory validation -- validate stash API, and validate cons_free calls. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: use strtof instead of atofKeith Packard2017-12-02
| | | | | | atof returns double, strtof returns float. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Convert more builtin lisp code to scheme formatKeith Packard2017-12-02
| | | | | | Use defines where possible, use (define (name args ...)) form for lambdas Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Overflow int computations to floatKeith Packard2017-12-02
| | | | | | When an int computation overflows, switch to float. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Build TeleMega v3.0 by defaultKeith Packard2017-12-02
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add TeleMega v3.0Keith Packard2017-12-02
| | | | | | Adds files to build telemega v3.0 flash loader and firmware Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/kernel: MPU9250 supportKeith Packard2017-12-02
| | | | | | | Use MPU9250 for accel, gyro and mag data in logging, telemetry and flight status computations. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: split set/def. Add def support to lambdasKeith Packard2017-12-01
| | | | | | | | In scheme, set can only re-define existing variables while def cannot redefine existing variables in lambda context. Def within lambda creates a new variable at the nearest enclosing scope. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Split out frame vals from frame structKeith Packard2017-12-01
| | | | | | | This lets the frame be resized without moving the base structure. The plan is to allow all frames to be resized, not just the global frame. Signed-off-by: Keith Packard <keithp@keithp.com>
* 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
|/