summaryrefslogtreecommitdiff
path: root/gps-cksum
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-04-17 23:38:14 -0700
committerKeith Packard <keithp@keithp.com>2009-04-17 23:38:14 -0700
commit022f83ca6fd589005d8eb3e25e633950fef69fa7 (patch)
tree4a081c02188cadbc93de00c96cd2f6a8f2b59d53 /gps-cksum
parent5e2393eb6b1a6d7b180bd63d5165ee7b7ff5f9e0 (diff)
Add gps, debug dongle support and pressure alt tables
GPS also pulled in serial support. The altitude tables take raw 11-bit pressure sample numbers and convert them to standard pressure altitude values. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'gps-cksum')
-rwxr-xr-xgps-cksum17
1 files changed, 17 insertions, 0 deletions
diff --git a/gps-cksum b/gps-cksum
new file mode 100755
index 00000000..a08153bf
--- /dev/null
+++ b/gps-cksum
@@ -0,0 +1,17 @@
+#!/usr/bin/env nickle
+
+int checksum(string a)
+{
+ int c = 0;
+ for (int i = 0; i < String::length(a); i++)
+ c ^= a[i];
+ return c;
+}
+
+void main()
+{
+ for (int i = 1; i < dim(argv); i++)
+ printf ("$%s*%02x\n", argv[i], checksum(argv[i]));
+}
+
+main();