summaryrefslogtreecommitdiff
path: root/altosui
diff options
context:
space:
mode:
authorBdale Garbee <bdale@gag.com>2012-05-16 09:13:53 -0600
committerBdale Garbee <bdale@gag.com>2012-05-16 09:13:53 -0600
commit6a973f788563ccc66b01cc7557a004dabef18d09 (patch)
treeffbc8faad73cde7934c4050deb840092430a311f /altosui
parentd387f246b24502642b76aad04eb3e0f1a5b78a05 (diff)
parentda2c920b9f3378d5a18551e008c1da5dace1e0ef (diff)
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Diffstat (limited to 'altosui')
-rw-r--r--altosui/AltosCSV.java11
-rw-r--r--altosui/AltosTelemetryIterable.java9
2 files changed, 15 insertions, 5 deletions
diff --git a/altosui/AltosCSV.java b/altosui/AltosCSV.java
index cf649db0..9ec21bef 100644
--- a/altosui/AltosCSV.java
+++ b/altosui/AltosCSV.java
@@ -31,9 +31,9 @@ public class AltosCSV implements AltosWriter {
LinkedList<AltosRecord> pad_records;
AltosState state;
- static final int ALTOS_CSV_VERSION = 3;
+ static final int ALTOS_CSV_VERSION = 4;
- /* Version 3 format:
+ /* Version 4 format:
*
* General info
* version number
@@ -41,6 +41,7 @@ public class AltosCSV implements AltosWriter {
* flight number
* callsign
* time (seconds since boost)
+ * clock (tick count / 100)
* rssi
* link quality
*
@@ -91,13 +92,13 @@ public class AltosCSV implements AltosWriter {
*/
void write_general_header() {
- out.printf("version,serial,flight,call,time,rssi,lqi");
+ out.printf("version,serial,flight,call,time,clock,rssi,lqi");
}
void write_general(AltosRecord record) {
- out.printf("%s, %d, %d, %s, %8.2f, %4d, %3d",
+ out.printf("%s, %d, %d, %s, %8.2f, %8.2f, %4d, %3d",
ALTOS_CSV_VERSION, record.serial, record.flight, record.callsign,
- (double) record.time,
+ (double) record.time, (double) record.tick / 100.0,
record.rssi,
record.status & 0x7f);
}
diff --git a/altosui/AltosTelemetryIterable.java b/altosui/AltosTelemetryIterable.java
index 278cbfb7..a1b25332 100644
--- a/altosui/AltosTelemetryIterable.java
+++ b/altosui/AltosTelemetryIterable.java
@@ -88,6 +88,15 @@ public class AltosTelemetryIterable extends AltosRecordIterable {
if (previous != null)
records.add(previous);
+ /* Adjust all tick counts to match expected eeprom values,
+ * which starts with a 16-bit tick count 16 samples before boost
+ */
+
+ int tick_adjust = (boost_tick - 16) & 0xffff0000;
+ for (AltosRecord r : this)
+ r.tick -= tick_adjust;
+ boost_tick -= tick_adjust;
+
/* adjust all tick counts to be relative to boost time */
for (AltosRecord r : this)
r.time = (r.tick - boost_tick) / 100.0;