Add initial teleterra implementation.
authorKeith Packard <keithp@keithp.com>
Sun, 31 Oct 2010 02:36:29 +0000 (19:36 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 31 Oct 2010 02:36:29 +0000 (19:36 -0700)
Not a lot of new code here, but it does test the teleterra audio system.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/Makefile
src/Makefile.proto
src/ao.h
src/ao_pins.h
src/ao_teleterra.c
src/ao_terraui.c [new file with mode: 0644]
src/teleterra-v0.1/.gitignore [new file with mode: 0644]
src/teleterra-v0.1/.sdcdbrc [new file with mode: 0644]
src/teleterra-v0.1/Makefile [new file with mode: 0644]

index 95d24425df9212f58ffe6a05897f8af9f83efa84..c02b3d73b50e7ccfbc30b5d87fd8bd5f6f6d3827 100644 (file)
@@ -6,7 +6,7 @@ CC=sdcc
 
 include Version
 
-SUBDIRS=telemetrum-v1.0 teledongle-v0.2 telemetrum-v0.1-sky telemetrum-v0.1-sirf teledongle-v0.1 tidongle test
+SUBDIRS=telemetrum-v1.0 teledongle-v0.2 telemetrum-v0.1-sky telemetrum-v0.1-sirf teledongle-v0.1 teleterra-v0.1 tidongle test
 
 all: all-recursive
 
index b23eb2571255cdfea257e88c386393b0869a4ab7..2365030b2a0ac1b6f1197b1b85d4088a39aacce9 100644 (file)
@@ -147,6 +147,10 @@ TI_SRC = \
 
 TT_MAIN_SRC = \
        ao_teleterra.c
+
+TT_TASK_SRC = \
+       ao_terraui.c
+
 #
 # All sources for TeleTerra
 #
@@ -156,8 +160,8 @@ TT_SRC = \
        $(TELE_RECEIVER_SRC) \
        $(TELE_DRIVER_SRC) \
        $(TELE_COMMON_SRC) \
-       $(TT_MAIN_SRC)
-
+       $(TT_MAIN_SRC) \
+       $(TT_TASK_SRC)
 
 #
 # Sources for TeleDongle
index 5b174947c57ba893a74ae56e43dacffbaf132f92..a952c50dadb49561211b58cfab2252df30877353 100644 (file)
--- a/src/ao.h
+++ b/src/ao.h
@@ -1104,4 +1104,12 @@ ao_packet_slave_stop(void);
 void
 ao_packet_slave_init(void);
 
+/* ao_terraui.c */
+
+void
+ao_terraui(void);
+
+void
+ao_terraui_init(void);
+
 #endif /* _AO_H_ */
index e9a265b0837a4c300f54f1c8e51e94b4b6d1ee54..7836d95a77fb7f275effbf5192206164599a94cf 100644 (file)
        #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
 #endif
 
+#if defined(TELETERRA_V_0_1)
+       #define HAS_SERIAL_1            1
+       #define HAS_ADC                 0
+       #define HAS_DBG                 1
+       #define HAS_EEPROM              0
+       #define DBG_ON_P1               1
+       #define DBG_ON_P0               0
+       #define PACKET_HAS_MASTER       1
+       #define PACKET_HAS_SLAVE        0
+       #define AO_LED_RED              1
+       #define AO_LED_GREEN            2
+       #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
+#endif
+
 #if defined(TIDONGLE)
        #define HAS_SERIAL_1            0
        #define HAS_ADC                 0
index d696b914e88c845a70d1789424b7e2ec21553281..422bd06a4b6ce5b9a88f3136d8572c0b5fece5a9 100644 (file)
@@ -31,8 +31,10 @@ main(void)
        ao_cmd_init();
        ao_usb_init();
        ao_serial_init();
+       ao_gps_init();
        ao_monitor_init(AO_LED_GREEN, TRUE);
        ao_radio_init();
        ao_config_init();
+       ao_terraui_init();
        ao_start_scheduler();
 }
diff --git a/src/ao_terraui.c b/src/ao_terraui.c
new file mode 100644 (file)
index 0000000..4837273
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright © 2010 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#include "ao.h"
+
+static __code uint8_t ready_beeps[] = {
+       AO_BEEP_g,      AO_MS_TO_TICKS(100),
+       AO_BEEP_bb,     AO_MS_TO_TICKS(100),
+       AO_BEEP_dd,     AO_MS_TO_TICKS(100),
+       AO_BEEP_gg,     AO_MS_TO_TICKS(200),
+       AO_BEEP_dd,     AO_MS_TO_TICKS(100),
+       AO_BEEP_gg,     AO_MS_TO_TICKS(400),
+};
+
+#define NUM_READY      (sizeof(ready_beeps) / 2)
+
+__xdata uint8_t        ao_terraui_wakeup;
+
+void
+ao_terraui(void)
+{
+       uint8_t i;
+
+       for (i = 0; i < sizeof(ready_beeps); i += 2)
+               ao_beep_for(ready_beeps[i], ready_beeps[i+1]);
+       for (;;)
+               ao_sleep(&ao_terraui_wakeup);
+}
+
+static __xdata struct ao_task  terraui_task;
+
+void
+ao_terraui_init(void)
+{
+       ao_add_task(&terraui_task, ao_terraui, "terraui");
+}
diff --git a/src/teleterra-v0.1/.gitignore b/src/teleterra-v0.1/.gitignore
new file mode 100644 (file)
index 0000000..37c290a
--- /dev/null
@@ -0,0 +1,2 @@
+teleterra-*
+ao_product.h
diff --git a/src/teleterra-v0.1/.sdcdbrc b/src/teleterra-v0.1/.sdcdbrc
new file mode 100644 (file)
index 0000000..710b4a2
--- /dev/null
@@ -0,0 +1 @@
+--directory=..
diff --git a/src/teleterra-v0.1/Makefile b/src/teleterra-v0.1/Makefile
new file mode 100644 (file)
index 0000000..d8867b1
--- /dev/null
@@ -0,0 +1 @@
+include ../Makefile.proto