summaryrefslogtreecommitdiff
path: root/src/kernel
Commit message (Collapse)AuthorAge
* altos: Make panic beeps use fixed frequenciesKeith Packard2018-03-16
| | | | | | | This ensures that the beeps will work even before the configuration has been loaded. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/kernel: Use ao_put_string for syntax error messageKeith Packard2018-01-07
| | | | | | Avoid using puts, which can be a large library function. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/kernel: Allow ao_cmd to be built without taskingKeith Packard2017-12-12
| | | | | | Useful for single-threaded applications, like lambdakey Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow building with newlib + avr stdio on ARMKeith Packard2017-12-11
| | | | | | | Redefines some stdio bits so that we can build with either pdclib or newlib + avr stdio. 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: 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: 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: 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: Fix debug printf in ao_pyro for state >=Keith Packard2017-09-12
| | | | 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: 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 branch 'master' of ssh://git.gag.com/scm/git/fw/altosBdale Garbee2017-07-21
|\
| * altos: Create separate log format for EasyMini v2.0Keith Packard2017-06-11
| | | | | | | | | | | | | | The ADC in the STM32F0 is different than the LPC, with a range of 0-4095 instead of 0-32767. Signed-off-by: Keith Packard <keithp@keithp.com>
| * altos: HMC5883 output order is X Z YKeith Packard2017-06-11
| | | | | | | | | | | | | | | | | | | | Re-label everything to have the correct names. This doesn't actually change the code at all, so the eeprom and telemetry is all compatible. Matching changes on the host side will be required to actually process the data correctly, of course. Signed-off-by: Keith Packard <keithp@keithp.com>
* | clean up telefireone name referencesBdale Garbee2017-07-21
|/
* telefiretwo: don't try to record pre-burn sensor values in FLIGHT recordBdale Garbee2017-05-11
|
* altos: Move 'ao_force_freq' to ao_config.cKeith Packard2017-05-04
| | | | | | Instead of having to add it to each product using this variable. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make CDC ACM 'line coding' publicKeith Packard2017-05-04
| | | | | | This allows other systems to see what baud rate the host has requested. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/kernel: Allow TeleGPS v2 to scale battery in telemKeith Packard2017-04-30
| | | | | | | | | TeleGPS v2 uses the STMF0 processor instead of the LPC11, which means the ADC range is different. As the raw ADC value was getting sent to represent battery voltage in the config packet, we need to scale that for the different processor. This patch allows that to happen. Signed-off-by: Keith Packard <keithp@keithp.com>
* src/kernel: Add GPS lock blink LED to tracker codeKeith Packard2017-04-30
| | | | | | Blinks an LED briefly once every three seconds when GPS is locked. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add header file for ao_report_micro.cKeith Packard2017-04-28
| | | | | | Defines the functions in this file. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add 100ms constants for baro Kalman filterKeith Packard2017-04-27
| | | | | | MicroPeak v2 uses this rate. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Adapt micro log to MicroPeak V3Keith Packard2017-04-27
| | | | | | | Allow use of regular serial API for sending data. Allow application to specify different storage size. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Move old AO_LAUNCH defines to cc1111/ao_launch.hKeith Packard2017-04-22
| | | | | | These were getting accidentally used by ao_pad.c Signed-off-by: Keith Packard <keithp@keithp.com>
* allow multiple tests to be logged on telefiretwo without rebootingBdale Garbee2017-04-23
|
* a stab at turning on rudimentary logging for telefiretwoBdale Garbee2017-04-22
|
* fleshing out logging for telefiretwoBdale Garbee2017-04-22
|
* altos: Allow for console to be used for stdioKeith Packard2017-02-20
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Don't wait while idle if trying to minimize interrupt latencyKeith Packard2017-02-20
| | | | | | | | Keeping the scanout running reasonably means keeping interrupt latency constant, and that requires leaving the CPU running. Don't wait for interrupts when the system is running in this mode. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Split out TeleMini v3 log/telem labelingKeith Packard2017-02-20
| | | | | | | Allow the ground software to know which TeleMini version is in use, even though they are very similar with only ADC values differing. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow applications to define LEDs for ao_report.cKeith Packard2017-02-20
| | | | | | In case they don't have both a red and green LED. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Eliminate printf format warning with long vs intKeith Packard2017-02-20
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/kernel: Make ao_cmd_readline public. Return char from ao_cmd_lex.Keith Packard2017-02-20
| | | | | | | With these two changes, the readline function can be used by other code. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/arm: Align data so that gcc 5.4 doesn't do byte-accesses. Add -Wcast-alignKeith Packard2016-12-17
| | | | | | | | | | | | | | | | | | | | | | Gcc 5.4.1 tracks alignment of data through assignments, so that a uint32_t pointer which comes from byte-aligned uint8_t data: extern uint8_t foo[]; uint32_t *q = (void *) foo; Fetches and stores through this pointer are done bytewise. This is slow (meh), but if q references a device register, things to bad very quickly. This patch works around this bug in the compiler by adding __attribute__((aligned(4))) tags to some variables, or changing them from uint8_t to uint32_t. Places doing this will now be caught as I've added -Wcast-align to the compiler flags. That required adding (void *) casts, after the relevant code was checked to make sure the compiler could tell that the addresses were aligned. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/test: Fix testsKeith Packard2016-10-30
| | | | | | | A couple of fixups for ao_flight_test to dump pyro info only when running in debug mode, and to change the aprs testing Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Don't switch to flight 0 when log fills in flightKeith Packard2016-07-27
| | | | | | | | | If the log is full at startup, we want to transmit flight 0 to let the ground station know. However, we don't want to switch to flight 0 in flight, so save the initial telemetry flight number (0 or the real flight number) at startup and use that throughout the flight. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Expose cc1200 radio test functions for telemini bringupKeith Packard2016-07-27
| | | | | | | | This exposes the cc1200 radio test function so we can load special test firmware in telemini to do the radio cal as it has no USB to perform that interactively. Signed-off-by: Keith Packard <keithp@keithp.com>
* fixup for interleaveKeith Packard2016-07-27
|
* altos: Keep telemetry and command output from interleavingKeith Packard2016-07-27
| | | | | | | | | | When monitoring telemetry, the frame needs to be sent together on one line, not split with the output of a command (like 'a') mixed in. Use a mutex for products with monitoring to keep command output and telemetry output each on separate lines. Signed-off-by: Keith Packard <keithp@keithp.com>
* Switch from GPLv2 to GPLv2+Keith Packard2016-07-12
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Leave USB enabled in flight with -DDEBUG=1Keith Packard2016-06-29
| | | | | | This leaves the command line available for diagnostics when debugging. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make task list output more usefulKeith Packard2016-06-29
| | | | | | Add the timeout value and task id Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make ao_delay(0) not wait foreverKeith Packard2016-06-29
| | | | | | | | | ao_delay() is implemented on top of ao_sleep_for, and ao_sleep_for uses the timeout value of 0 to indicate an infinite timeout. Calls to ao_delay for 0 ticks would unintentionally hit this case and end up waiting forever.x Signed-off-by: Keith Packard <keithp@keithp.com>