TELE_DRIVER_SRC = \
ao_convert.c \
- ao_gps_skytraq.c \
ao_serial.c
#
ao_gps_report.c \
ao_ignite.c
+#
+# Drivers only on TeleMetrum
+#
+TM_SIRF_DRIVER_SRC = \
+ ao_gps_sirf.c
+#
+# Drivers only on TeleMetrum
+#
+TM_SKY_DRIVER_SRC = \
+ ao_gps_skytraq.c
+
#
# Tasks run on TeleMetrum
#
$(TM_TASK_SRC) \
$(TM_MAIN_SRC)
+TM_SIRF_SRC = \
+ $(TM_SRC) \
+ $(TM_SIRF_DRIVER_SRC)
+
+TM_SKY_SRC = \
+ $(TM_SRC) \
+ $(TM_SKY_DRIVER_SRC)
+
TI_MAIN_SRC = \
ao_tidongle.c
$(TELE_COMMON_SRC) \
$(TELE_FAKE_SRC) \
$(TM_DRIVER_SRC) \
+ $(TM_SIRF_DRIVER_SRC) \
+ $(TM_SKY_DRIVER_SRC) \
$(TM_TASK_SRC) \
$(TM_MAIN_SRC) \
$(TI_MAIN_SRC) \
$(TD_MAIN_SRC) \
$(TT_MAIN_SRC)
-TM_REL=$(TM_SRC:.c=.rel) ao_product-telemetrum.rel
+TM_SIRF_REL=$(TM_SIRF_SRC:.c=.rel) ao_product-telemetrum.rel
+TM_SKY_REL=$(TM_SKY_SRC:.c=.rel) ao_product-telemetrum.rel
TI_REL=$(TI_SRC:.c=.rel) ao_product-tidongle.rel
TT_REL=$(TT_SRC:.c=.rel) ao_product-teleterra.rel
TD_REL=$(TD_SRC:.c=.rel) ao_product-teledongle.rel
RST=$(REL:.rel=.rst)
SYM=$(REL:.rel=.sym)
-PROGS= telemetrum.ihx tidongle.ihx \
+PROGS= telemetrum-sirf.ihx telemetrum-sky.ihx tidongle.ihx \
teleterra.ihx teledongle.ihx
HOST_PROGS=ao_flight_test ao_gps_test ao_gps_test_skytraq
all: $(PROGS) $(HOST_PROGS)
-telemetrum.ihx: $(TM_REL) Makefile
- $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TM_REL)
- sh check-stack ao.h telemetrum.mem
+telemetrum-sirf.ihx: $(TM_SIRF_REL) Makefile
+ $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TM_SIRF_REL)
+ sh check-stack ao.h telemetrum-sirf.mem
+
+telemetrum-sky.ihx: $(TM_SKY_REL) Makefile
+ $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TM_SKY_REL)
+ sh check-stack ao.h telemetrum-sky.mem
+
+telemetrum-sky.ihx: telemetrum-sirf.ihx
tidongle.ihx: $(TI_REL) Makefile
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TI_REL)
sh check-stack ao.h tidongle.mem
-tidongle.ihx: telemetrum.ihx
+tidongle.ihx: telemetrum-sky.ihx
teleterra.ihx: $(TT_REL) Makefile
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TT_REL)
--- /dev/null
+#!/usr/bin/env nickle
+
+int checksum(int[] msg)
+{
+ int sum = 0;
+ for (int i = 0; i < dim(msg); i++) {
+ sum ^= msg[i];
+ sum &= 0xff;
+ }
+ return sum;
+}
+
+void main()
+{
+ string[...] input;
+ int[...] msg;
+
+ setdim(input, 0);
+ while (!File::end(stdin)) {
+ input[dim(input)] = gets();
+ }
+
+ setdim(msg, 0);
+ for (int i = 0; i < dim(input); i++) {
+ string[*] words = String::wordsplit(input[i], " ,\t");
+ for (int j = 0; j < dim(words); j++) {
+ if (words[j] == "/" + "*")
+ break;
+ if (String::length(words[j]) > 0 &&
+ Ctype::isdigit(words[j][0])) {
+ msg[dim(msg)] = string_to_integer(words[j]);
+ }
+ }
+ }
+ printf("\t0xa0, 0xa1, 0x02x, 0x%02x,\t\t/* length: %d bytes */\n",
+ dim(msg) >> 8, dim(msg) & 0xff, dim(msg));
+ for (int i = 0; i < dim(input); i++)
+ printf("%s\n", input[i]);
+ int csum = checksum(msg);
+ printf ("\t0x%02x, 0x0d, 0x0a,\n",
+ csum);
+}
+
+main();