From c1760cebd47d0f03808f3204c0fcb1183f754e50 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 6 May 2011 15:44:56 -0700 Subject: [PATCH] altos: Add preliminary telebt v0.1 defines This should make the telebt v0.1 binary that works on the real hardware. Signed-off-by: Keith Packard --- src/Makefile.proto | 8 +++++++- src/ao_log_telem.c | 30 ++++++++++++++++++++++++++++++ src/ao_pins.h | 28 ++++++++++++++++++++++++++++ src/ao_telebt.c | 4 ++++ src/telebt-v0.1/.gitignore | 2 ++ src/telebt-v0.1/.sdcdbrc | 1 + src/telebt-v0.1/Makefile | 1 + src/telebt-v0.1/Makefile.defs | 8 ++++++++ 8 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 src/ao_log_telem.c create mode 100644 src/telebt-v0.1/.gitignore create mode 100644 src/telebt-v0.1/.sdcdbrc create mode 100644 src/telebt-v0.1/Makefile create mode 100644 src/telebt-v0.1/Makefile.defs diff --git a/src/Makefile.proto b/src/Makefile.proto index ca68edbc..04b708b2 100644 --- a/src/Makefile.proto +++ b/src/Makefile.proto @@ -238,7 +238,7 @@ TNANO_BASE_SRC = \ $(TNANO_MAIN_SRC) # -# Sources for TeleDongle +# Sources for TeleBluetooth # TBT_MAIN_SRC = \ @@ -255,6 +255,12 @@ TBT_BASE_SRC = \ $(DBG_SRC) \ $(TBT_MAIN_SRC) +TBT_V_0_1_SRC = \ + $(TBT_BASE_SRC) \ + $(SPI_DRIVER_SRC) \ + $(M25_DRIVER_SRC) \ + ao_log_telem.c + # # TI Dongle sources # diff --git a/src/ao_log_telem.c b/src/ao_log_telem.c new file mode 100644 index 00000000..1b472efe --- /dev/null +++ b/src/ao_log_telem.c @@ -0,0 +1,30 @@ +/* + * Copyright © 2011 Keith Packard + * + * 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" + +void +ao_log_write_erase(uint8_t pos) +{ + (void) pos; +} + +uint8_t +ao_log_present(void) +{ + return 0; +} diff --git a/src/ao_pins.h b/src/ao_pins.h index 324d7827..bc9bdcb9 100644 --- a/src/ao_pins.h +++ b/src/ao_pins.h @@ -243,6 +243,34 @@ #define HAS_IGNITE 0 #endif +#if defined(TELEBT_V_0_1) + #define HAS_FLIGHT 0 + #define HAS_USB 1 + #define HAS_BEEP 0 + #define HAS_SERIAL_1 1 + #define USE_SERIAL_STDIN 1 + #define HAS_ADC 0 + #define HAS_DBG 1 + #define HAS_EEPROM 1 + #define USE_INTERNAL_FLASH 0 + #define HAS_BTM 1 + #define DBG_ON_P1 1 + #define DBG_ON_P0 0 + #define IGNITE_ON_P2 0 + #define IGNITE_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) + #define SPI_CS_ON_P1 1 + #define SPI_CS_ON_P0 0 + #define M25_CS_MASK 0x04 /* CS0 is P1_2 */ + #define M25_MAX_CHIPS 1 + #define HAS_ACCEL 0 + #define HAS_IGNITE 0 +#endif + #if DBG_ON_P1 #define DBG_CLOCK (1 << 4) /* mi0 */ diff --git a/src/ao_telebt.c b/src/ao_telebt.c index 295f0cec..34d4432d 100644 --- a/src/ao_telebt.c +++ b/src/ao_telebt.c @@ -27,6 +27,10 @@ main(void) ao_led_on(AO_LED_RED); ao_timer_init(); ao_cmd_init(); +#if HAS_EEPROM + ao_spi_init(); + ao_storage_init(); +#endif ao_usb_init(); ao_monitor_init(AO_LED_GREEN, TRUE); ao_rssi_init(AO_LED_RED); diff --git a/src/telebt-v0.1/.gitignore b/src/telebt-v0.1/.gitignore new file mode 100644 index 00000000..1acfbfcc --- /dev/null +++ b/src/telebt-v0.1/.gitignore @@ -0,0 +1,2 @@ +telebt-* +ao_product.h diff --git a/src/telebt-v0.1/.sdcdbrc b/src/telebt-v0.1/.sdcdbrc new file mode 100644 index 00000000..710b4a2f --- /dev/null +++ b/src/telebt-v0.1/.sdcdbrc @@ -0,0 +1 @@ +--directory=.. diff --git a/src/telebt-v0.1/Makefile b/src/telebt-v0.1/Makefile new file mode 100644 index 00000000..d8867b19 --- /dev/null +++ b/src/telebt-v0.1/Makefile @@ -0,0 +1 @@ +include ../Makefile.proto diff --git a/src/telebt-v0.1/Makefile.defs b/src/telebt-v0.1/Makefile.defs new file mode 100644 index 00000000..50657c83 --- /dev/null +++ b/src/telebt-v0.1/Makefile.defs @@ -0,0 +1,8 @@ +PROG = telebt-v0.1-$(VERSION).ihx + +SRC = \ + $(TBT_V_0_1_SRC) + +PRODUCT=TeleBT-v0.1 +PRODUCT_DEF=-DTELEBT_V_0_1 +IDPRODUCT=0x000e -- 2.30.2