ao_tracker: Fix tracker_interval type to match config type (plus -Wconversion) config.tracker_interval is uint8_t, so make the local copy match that type. Also fix other warnings found by -Wconversion. Signed-off-by: Keith Packard <keithp@keithp.com>
ao_log: Change flight type to uint16_t, widen APIs dealing with flight numbers to int32_t Real Flight numbers are 16-bit unsigned values, but APIs using them pass values that areoverloaded to also represent broken log slots using negative numbers. This means that these APIs need to be able to represent all 65535 possible flight numbers *and* all possible log slots as negative values. Switch the variables holding only flight numbers to uint16_t and those holding either a flight number or log slot to int32_t. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Switch all tick variables to AO_TICK_TYPE/AO_TICK_SIGNED Instead of trying to pick and choose which work as 16-bit values, change everything that doesn't affect external values (log, companion, radio) to AO_TICK_TYPE. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Fix printf format mis-matches Lots of values passed to printf are 'long' instead of 'int', so fix the formats to use the right size indicator. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Eliminate 'pin' field from GPIO functions 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: Make cmd number parsing functions return value Don't use a global variable to hold the result. Signed-off-by: Keith Packard <keithp@keithp.com>
src/kernel: Add GPS lock blink LED to tracker code Blinks an LED briefly once every three seconds when GPS is locked. Signed-off-by: Keith Packard <keithp@keithp.com>
Switch from GPLv2 to GPLv2+ Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Separate out ao_tracker force from dbg Allow enabling telemetry when USB is connected without also enabling the motion debugging output. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Don't add AO_LOG_FLIGHT to existing GPS logs When appending to a TeleGPS log, don't stick another flight value into the log. That just confuses the ground station software. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Extend GPS altitudes to at least 24 bits everywhere Telemetry gets a special 'mode' flag indicating that 24-bit data is present; log files get new data and log readers are expected to detect that via the firmware version number. Signed-off-by: Keith Packard <keithp@keithp.com>
altos/telegps: Create new flight if current flight is erased telegps is unique in that USB may be connected while a flight is active and sensible things should happen. If a flight is being recorded and gets erased, then a new flight should be started. This is done by hooking in the flight erase code and calling out to the tracker code to figure out whether to switch to a new flight or not. Signed-off-by: Keith Packard <keithp@keithp.com>
altos/telegps: Keep ring of recent GPS positions to detect motion quickly Instead of comparing only against the last logged value, keep a ring and start logging as soon as we move away from the furthest one in the ring. Signed-off-by: Keith Packard <keithp@keithp.com>
altos/telegps: Don't log data when plugged in to USB We don't want to accidentally log stuff when you're just trying to charge the battery. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Simplify tracker logic, removing boost detect This removes the ao_flight_state value from the tracker code and makes it simply log position information when the device has moved within the last 10 log intervals. This also changes the configuration parameters to define what 'motionless' means, and what interval to configure the GPS receiver for, log data and send telemetry. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Define lat/lon sum variables as 64-bit instead of 16 Oops. 16 bits won't hold position information... Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Write tracker logging from tracker thread directly Also, logs 8 pre-launch GPS packets so we can get the ground position. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Move ao_tracker.c to kernel Doesn't make sense to be in product Signed-off-by: Keith Packard <keithp@keithp.com>