summaryrefslogtreecommitdiff
path: root/src/util/gps-cksum
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-08-25 20:43:44 -0700
committerKeith Packard <keithp@keithp.com>2011-08-25 20:49:11 -0700
commit9513be7f9d3d0b0ec29f6487fa9dc8f1ac24d0de (patch)
tree6cfa006884cab18f56e95c79c3268df4817885f1 /src/util/gps-cksum
parent3bfe8df44b575ca430ffaa051e20faa955a06c03 (diff)
altos: Restructure altos build to prepare for multi-arch support
Split out sources into separate directories: core: architecture and product independent bits cc1111: cc1111-specific code drivers: architecture independent drivers product: product-specific sources and Makefile fragments util: scripts for building stuff This should have no effect on the built products, but testing is encouraged Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/util/gps-cksum')
-rwxr-xr-xsrc/util/gps-cksum17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/util/gps-cksum b/src/util/gps-cksum
new file mode 100755
index 00000000..a08153bf
--- /dev/null
+++ b/src/util/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();