summaryrefslogtreecommitdiff
path: root/src/kernel
Commit message (Collapse)AuthorAge
* altos: Remove AO_LOG_STATE from ao_log_telefiretwoKeith Packard2019-02-18
| | | | | | | | | | Telefiretwo never changes flight state, so these packets weren't going to be written. Also stop passing &log to ao_log_firetwo -- it always got the global anyways, just use it directly. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add -Wshadow to CFLAGSKeith Packard2019-02-18
| | | | | | And fix up the related messages. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Declare task stack as union of uint8_t and uint32_tKeith Packard2019-02-18
| | | | | | | Support -Wcast-align and -Wpointer-arith while still allowing architectures to pick whether they want an 8-bit or 32-bit stack. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Stop doing pointer arith on void *Keith Packard2019-02-18
| | | | | | Switch to uint8_t * instead. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Declare all public functions in header filesKeith Packard2019-02-18
| | | | | | | Including interrupt vectors to catch mis-spellings. Working toward supporting -Wmissing-prototypes Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Mark local functions 'static'Keith Packard2019-02-18
| | | | | | Working towards supporting -Wmissing-prototypes Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: add initial support for TeleFireOne v2.0Bdale Garbee2019-02-17
|
* altos: Make HAS_ACCEL_DEBUG build againKeith Packard2018-12-30
| | | | | | Need to not use ao_error_h_sq_avg without HAS_ACCEL Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/easymega-v2.0: Handle different mpu9250 orientationKeith Packard2018-10-20
| | | | | | | The mpu9250 on EasyMega v2.0 is rotated 90° compared with EasyMega v1 and TeleMega IMU devices. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add ADXL375 driver [v2]Keith Packard2018-10-19
| | | | | | | Includes self-test code and multi-byte mode operation for reading sample registers. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Create ao_data_fill shared functionKeith Packard2018-10-19
| | | | | | | This fills a data ring entry with all of the current sensor values other than the ADC. It is used in all of the adc completion functions. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up AO_ROMCONFIG bitsKeith Packard2018-10-13
| | | | | | | Remove address parameter (doesn't work with gcc), create shared ao_romconfig in kernel. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm32f4: Align stack to 8 bytesKeith Packard2018-10-13
| | | | | | This makes sure that doubles are aligned properly when passed on the stack. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add generic LED driver.Keith Packard2018-10-13
| | | | | | | | | | | This driver uses the generic GPIO functions and allows per-LED port and pin configuration. It supports up to 32 LEDs. Rename SoC-specific LED drivers. Remove enabled parameter to ao_led_init Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Eliminate 'pin' field from GPIO functionsKeith Packard2018-10-13
| | | | | | | This was used with the 8051 bit-addressing mode to provide single-instruction access to GPIO pins. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Remove 8051-ism from ao_usb.hKeith Packard2018-10-13
| | | | | | __at doesn't exist for non-8051 Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Delete random 8051 ISR declarationsKeith Packard2018-10-13
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow application-specific prompts for ao_cmd_readlineKeith Packard2018-10-13
| | | | | | Lets other readline users specify alternate prompts. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use stdbool true/false instead of TRUE/FALSEKeith Packard2018-10-13
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make cmd number parsing functions return valueKeith Packard2018-10-13
| | | | | | Don't use a global variable to hold the result. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Remove 8051 address space specifiersKeith Packard2018-10-13
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Remove *_TO_DATA macrosKeith Packard2018-10-13
| | | | | | Now that we don't support 8051, we don't need these Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Switch to newlib-nano for libc on armKeith Packard2018-10-13
| | | | | | Stop using pdclib Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Force telemetry rate to 38400 when ao_force_freq is setKeith Packard2018-10-04
| | | | | | | | ao_force_freq is used by TeleMini to set the radio to known values. As TeleMini v3.0 also has configurable telemetry rates, this value also needs to be set back to a known value. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Switch global 'log' to 'ao_log_data'Keith Packard2018-08-15
| | | | | | Avoid conflicts with 'log' math function. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Remove spurious 'const' from ao_state_namesKeith Packard2018-08-15
| | | | | | Current gcc complains about this. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add separate 'ao_launch_tick'. Use in pyro and lockout.Keith Packard2018-08-05
| | | | | | | | | | | | | | | | Prior to this, there was only ao_boost_tick, which got reset at each motor burn start. That meant there wasn't any way to measure total flight time for pyro channels and 'apogee lockout' was based on time since most recent motor start instead of total flight time. Now pyro channels and apogee lockout both use total flight time, while motor burn length still uses time since most recent motor burn start (as it should). Docs and UI updated to use 'launch' instead of 'boost' to try and make the change clear. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Change 'after motor' pyro check to be >= instead of ==Keith Packard2018-08-05
| | | | | | This makes after motor stay valid even if further motors burn. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/test: Compute and show height error tracker in ao_flight_testKeith Packard2018-07-02
| | | | | | | Enable the computation of ao_error_h_sq_avg in ao_flight_test even when an accelerometer is present to allow review of that data. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Eliminate height requirement for coast detectKeith Packard2018-05-07
| | | | | | | | | | | We had required a minimum altitude of 100m to transition from boost to coast. With small motors in a heavy multi-staged rocket, this can fail to detect coast in time to light the second motor. Also, this would fail to deploy recovery systems if the flight failed before reaching 100m. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/chaoskey-v1.0: Add endpoint for reading flash contentsKeith Packard2018-05-07
| | | | | | | This creates another IN endpoint which provides the contents of flash for validation of the firmware load on the host. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/kernel: Add USB descriptors for IN3Keith Packard2018-05-07
| | | | | | | This adds the necessary descriptor information to support another IN endpoint for applications. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/kernel: Define usb IN2/IN3 functionsKeith Packard2018-05-07
| | | | | | | These are putchar and flush functions that are used when sending data to the additional IN2 and IN3 endpoints. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use max of 64 previous orient values when checking pyro limitsKeith Packard2018-04-26
| | | | | | | | | Instead of checking just a single measurement to see if the orientation is outside of the desired limits, use the maximum of 64 previous values to that rapidly changing orientation won't accidentally enable a pyro channel if sampled at the 'wrong time'. Signed-off-by: Keith Packard <keithp@keithp.com>
* 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>