summaryrefslogtreecommitdiff
path: root/src/core
Commit message (Collapse)AuthorAge
* altos: Rename 'core' to 'kernel'Keith Packard2014-04-05
| | | | | | | core remains a bad name to use -- dirvish skips files (and directories, it seems) with that name. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: HAS_LED is useless; remove itKeith Packard2014-03-28
| | | | | | | | | | | | ao_flight was trying to decide whether to turn off the red LED by checking whether HAS_LED was defined. And yet, none of the flight firmware defines that anymore, except for easymini which defines it to zero. Remove all uses and defines of this value, substituting AO_LED_RED in ao_flight.c, which has to be defined for the ao_led_off call to work. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Don't require projects to define PACKET_HAS_SLAVEKeith Packard2014-03-09
| | | | | | | Really, most don't need it, and whinging about not having it defined isn't useful. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make balloon code run againKeith Packard2014-02-18
| | | | | | This fixes the balloon code so that it works with recent altos bits Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Set reasonable accel values when !HAS_ACCELKeith Packard2014-02-18
| | | | | | This lets us use telemetrum log and telemetry formats for balloons Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Expose ao_usb_running globallyKeith Packard2014-02-18
| | | | | | This lets other bits of the code know when USB has been connected. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Move balloon flight code to coreKeith Packard2014-02-18
| | | | | | This lets us create more than one balloon product Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Tmega Don't try to log info about more than 12 GPS satsKeith Packard2014-01-24
| | | | | | | | | The mega log format has a single packet for GPS info which holds a maximum of 12 satellites. Bdale managed to get 14 sats in view, which ended up crashing the ground station software, and also overflowed the gps_tracking_data structure. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Report battery, apogee and main voltages over APRSKeith Packard2014-01-15
| | | | | | This makes APRS more usable when you mute the RF audio on the HT. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use factory calibration for all acceleration computationsKeith Packard2014-01-14
| | | | | | | | | The ground acceleration value will vary depending on the tilt angle of the airframe, which will result in incorrect acceleration computations during flight. This also avoids accidental boost detect when moving the airframe around in pad mode. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Flip acceleration data consistently for orientation changesKeith Packard2014-01-01
| | | | | | | | | | | Must flip the acceleration calibration data using the same function as flipping the actual acceleration data or the calibration will no longer be valid after changing orientation. For the MMA655x, this means using 4095 in both places, rather than using 0x7fff for the calibration data changes and 4095 for the data value changes. For the MPU6000, this means using 0 in both places. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add 'O' command for TeleMega orient testingKeith Packard2013-12-28
| | | | | | | | Only present when HAS_FLIGHT_DEBUG is enabled, this command lets the user check the orientation tracking code by showing the current orientation and when the calibration values are reset. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up warnings for LPC productsKeith Packard2013-12-20
| | | | | | Unused varibles, functions and parameters. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: unsigned value in ao_pyro_set checked for negative valueKeith Packard2013-12-20
| | | | | | No sense checking unsigned values for less than zero. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up -Wextra warningsKeith Packard2013-12-20
| | | | | | | Unused variables, mismatching signed/unsigned and a few other misc warnings. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up some minor warnings from -WallKeith Packard2013-12-20
| | | | | | Unused variables, functions and labels, missing enums in switch. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: mma655x also needs ao_sensor_errorsKeith Packard2013-12-20
| | | | | | | TeleMetrum has an MMA655X but no IMU, so it needs an explicit addition for sensor errors. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Complain about sensor self-test errors only in idle modeKeith Packard2013-12-20
| | | | | | | | | When the accelerometer says to go into pad mode, don't look for other sensor self test errors. Only look for sensor self test errors to choose between idle and invalid mode. This will prevent minor sensor self test errors from letting the rocket fly safely. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: 3-axis accel calibration was invalid in explicit accel cal modeKeith Packard2013-12-20
| | | | | | | | When explicit Z-axis accel calibration values were provided to the 'c a' command, the 3-axis accelerometer calibration values would get set to uninitialized values. Not so helpful. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Try IMU self-test 10 times before giving upKeith Packard2013-12-18
| | | | | | | | This should keep the device from failing to boot unless the IMU is actually broken. Oh, and if self test does fail, this places the flight computer in 'Invalid' state rather than panic. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Broke TeleMetrum GPS reporting by holding the GPS mutex too muchKeith Packard2013-12-17
| | | | | | | We can't hold the GPS mutex while waiting for the GPS receiver to load data as it protects the GPS data with the GPS mutex. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow products to override default 100mA USB currentKeith Packard2013-12-08
| | | | | | This will allow products to specify their own current limit. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add lots more GPS data to mega logKeith Packard2013-12-07
| | | | | | | There's plenty of space in the GPS log packets to hold course, speed, climb and DOP values, so just stick them in. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make sure flight erase log comes after config blogKeith Packard2013-11-12
| | | | | | | Oops. When converting from ao_storage to ao_config, I accidentally had the flight erase log overwriting the config block. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Move TeleMetrum v2.0 to using internal eeprom for configKeith Packard2013-11-12
| | | | | | This leaves the whole 8MB of flash for flight storage Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow use of internal EEPROM for config storageKeith Packard2013-11-12
| | | | | | | | | | | This stops exposing eeprom as 'storage' and instead exposes it with a separate eeprom API so that it can be used for config storage without also using it for flight log storage. The config code has been changed to allow it to either use storage for configuration data or eeprom. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Don't hold GPS mutex while waiting in TM v2.0 reportKeith Packard2013-11-12
| | | | | | | Holding the GPS mutex while waiting for the GPS code to dump data into the GPS variables is rather counter-productive. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add orientation tracking to ao_flight_testKeith Packard2013-11-12
| | | | | | Shows calculated offset from vertical in ao_flight_test output Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Don't hold GPS mutex while waiting for GPS data in report codeKeith Packard2013-10-28
| | | | | | Oops. This kinda breaks anyone else waiting for GPS data Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: sample profile address range was too narrowKeith Packard2013-10-28
| | | | | | | | The range was cranked down at some point to diagnose issues within the task scheduler. Unfortunately, that change got merged, which meant that general profiling lost information outside of the lower 4kB of code. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add orientation test when HAS_FLIGHT_DEBUG is setKeith Packard2013-10-27
| | | | | | | This just dumps the current orientation to stdout so you can monitor it in real time Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Fixup for 32-bit gyro averagesKeith Packard2013-10-27
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Correct incremental rotation computationKeith Packard2013-10-27
| | | | | | | | | | | Trying to compute the combined rotation by taking the x/y/z rotations as a vector is a good approximation, but not accurate enough for our application given the large angles we sometimes see. Instead, use a correct-but-expensive function with a pile of transcendental function calls. The STM32L seems to be fast enough at least... Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Compute initial rotation from verticalKeith Packard2013-10-27
| | | | | | | | | This initializes the rotation with the angle from vertical, rather than simply recording the off-angle vector. Doing this allows us to accurately track the true orientation of the rocket, instead of just the offset from the initial non-vertical orientation. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Fixup for ao_sample_orient renameKeith Packard2013-10-27
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Keep 9 more bits of average pad IMU gyro dataKeith Packard2013-10-27
| | | | | | This reduces the offset error by a bit, minimizing gyro drift. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Rename ao_orient to ao_sample_orientKeith Packard2013-10-27
| | | | | | Keeps it clear where this name comes from. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add functions to init quaternions from vector pairs and euler anglesKeith Packard2013-10-27
| | | | | | | | Our low sampling rate means that the "cheap" hack for integrating quaternion rotations by using sin(x) ≃ x doesn't work, so instead we have to compute the partial rotation the hard way. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add some comments describing quaternion multiplicationKeith Packard2013-10-27
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Mark arguments to quaternion functions as constKeith Packard2013-10-27
| | | | | | Lets us pass constants without the compile whinging Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: IMU accel calibration values need to be signedKeith Packard2013-10-27
| | | | | | The MPU6000 reports signed values. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Calibrate IMU accelerometers tooKeith Packard2013-10-25
| | | | | | | | Average the IMU accelerometer values pointing up and down so that we have a zero-g offset for all three axes. This can then be used to compute which direction the rocket is pointing while sitting on the pad. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add gyro-based orientation trackingKeith Packard2013-10-25
| | | | | | | This tracks the angle-from-vertical as an additional input to the pyro channels. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Merge GPS logging into a single functionKeith Packard2013-10-14
| | | | | | | | | | | | Create a new global, ao_gps_new, which indicates new GPS position and satellite data. Use ao_gps_new as the new sleep/wakeup address. Merge the separate gps position/satellite logging tasks into a single function which waits for new data and writes out the changed values. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/micropeak: Increase boost detect to 30mKeith Packard2013-10-13
| | | | | | | | | | | | | This meant increasing the data buffering as well so that we could reliably capture the flight data back to the ground, even for slow flights. And, with the buffer extra large, we work backwards from the current buffer location to find the last ground location rather than working forwards from the first buffered location. This ensures that we don't capture noise before boost and instead capture a nice flight curve instead. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Don't require an LED for ao_flightKeith Packard2013-10-07
| | | | | | EasyMini has no LEDs. Deal with it. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Move micropeak sources aroundKeith Packard2013-09-15
| | | | | | | | This sticks the micropeak sources in appropriate directories, rather than in the micropeak product directory so that they can be shared with future micropeak-style products. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Set tick value in new TeleMetrum v2 sensor packetsKeith Packard2013-09-05
| | | | | | Was getting left with the old value, which wasn't very useful Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib/altosui: Further AltosState transition workKeith Packard2013-08-31
| | | | | | | Parses most eeprom and telem records now; altosui updated to show from AltosState info. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Split EasyMini and TeleMini log formatsKeith Packard2013-08-29
| | | | | | | Same data, but EasyMini uses a 3.0V supply while TeleMini uses 3.3V, which changes the intepretation of all of the ADC values Signed-off-by: Keith Packard <keithp@keithp.com>