From 6358041f846ba9a20fa650c367d907dc4336e54c Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 22 Aug 2009 13:38:56 -0700 Subject: Enable GPS degraded mode, set 10 sec degraded timeout. No reason not to let the GPS report solutions whenever it likes, let's see how this works. Signed-off-by: Keith Packard --- src/ao_gps.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ao_gps.c b/src/ao_gps.c index 7d68b325..2b3a5178 100644 --- a/src/ao_gps.c +++ b/src/ao_gps.c @@ -30,14 +30,14 @@ const char ao_gps_config[] = { 0xa0, 0xa2, 0x00, 0x0e, /* length: 14 bytes */ 136, /* mode control */ 0, 0, /* reserved */ - 4, /* degraded mode (disabled) */ + 0, /* degraded mode (allow 1-SV navigation) */ 0, 0, /* reserved */ 0, 0, /* user specified altitude */ 2, /* alt hold mode (disabled, require 3d fixes) */ 0, /* alt hold source (use last computed altitude) */ 0, /* reserved */ - 0, /* Degraded time out (disabled) */ - 0, /* Dead Reckoning time out (disabled) */ + 10, /* Degraded time out (10 sec) */ + 10, /* Dead Reckoning time out (10 sec) */ 0, /* Track smoothing (disabled) */ 0x00, 0x8e, 0xb0, 0xb3, -- cgit v1.2.3 From 7d39f17684feb49ac8a0017902158f298696e37c Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 2 Sep 2009 21:57:54 -0700 Subject: Make eeprom reads and writes across block boundary work Reading and writing across the block boundary was not stepping the eeprom position after the partial i/o operation at the end of the first block. This meant that the operation would re-use the end of the previous block, either re-reading or re-writing it. Signed-off-by: Keith Packard --- src/ao_ee.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/ao_ee.c b/src/ao_ee.c index f299b925..9b6db234 100644 --- a/src/ao_ee.c +++ b/src/ao_ee.c @@ -271,6 +271,7 @@ ao_ee_write(uint32_t pos, uint8_t *buf, uint16_t len) __reentrant /* See how much is left */ buf += this_len; len -= this_len; + pos += this_len; } return 1; } @@ -306,6 +307,7 @@ ao_ee_read(uint32_t pos, uint8_t *buf, uint16_t len) __reentrant /* See how much is left */ buf += this_len; len -= this_len; + pos += this_len; } return 1; } -- cgit v1.2.3 From acea083d80e1ecc4287083519ea666964016b257 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 2 Sep 2009 22:00:37 -0700 Subject: Make the ao_log_record structures 8 bytes again. When the GPS signal strength data was added, the structure was accidentally extended to 9 bytes, making all log records 9 bytes long. While not a serious problem, this left log records spanning across eeprom block boundaries, which seems like a bad plan. Signed-off-by: Keith Packard --- src/ao.h | 1 - src/ao_gps_report.c | 1 - 2 files changed, 2 deletions(-) (limited to 'src') diff --git a/src/ao.h b/src/ao.h index 27ec010f..8e342558 100644 --- a/src/ao.h +++ b/src/ao.h @@ -503,7 +503,6 @@ struct ao_log_record { uint16_t svid; uint8_t state; uint8_t c_n; - uint8_t unused; } gps_sat; struct { uint16_t d0; diff --git a/src/ao_gps_report.c b/src/ao_gps_report.c index acf8bb40..75c944f5 100644 --- a/src/ao_gps_report.c +++ b/src/ao_gps_report.c @@ -75,7 +75,6 @@ ao_gps_tracking_report(void) (gps_log.u.gps_sat.state = gps_tracking_data.sats[c].state)) { gps_log.u.gps_sat.c_n = gps_tracking_data.sats[c].c_n_1; - gps_log.u.gps_sat.unused = 0; ao_log_data(&gps_log); } } -- cgit v1.2.3 From e2e449d5c23356e913f312de1fb2611a9dd5a352 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 2 Sep 2009 22:01:52 -0700 Subject: Remove bit-banging debug support from TM board builds Our current TM boards don't have the wires to do bit-banging to another cc1111 board, so it doesn't make sense to fill up their flash with useless code (and the 'help' text with useless commands). Leave this to the TI board until we have boards that can serve as debug dongles. Signed-off-by: Keith Packard --- src/Makefile | 10 ++++++++-- src/ao_log.c | 3 +++ src/ao_teledongle.c | 1 - src/ao_telemetrum.c | 1 - src/ao_teleterra.c | 1 - 5 files changed, 11 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 96049c65..828c48bd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -24,7 +24,6 @@ INC = \ # ALTOS_SRC = \ ao_cmd.c \ - ao_dbg.c \ ao_dma.c \ ao_mutex.c \ ao_panic.c \ @@ -70,6 +69,12 @@ TELE_FAKE_SRC = \ ao_adc_fake.c \ ao_ee_fake.c +# +# Debug dongle driver (only on TI) +# +DBG_DONGLE_SRC = \ + ao_dbg.c + # # Drivers only on TeleMetrum # @@ -115,7 +120,8 @@ TI_SRC = \ $(TELE_RECEIVER_SRC) \ $(TELE_COMMON_SRC) \ $(TELE_FAKE_SRC) \ - $(TI_MAIN_SRC) + $(TI_MAIN_SRC) \ + $(DBG_DONGLE_SRC) TT_MAIN_SRC = \ ao_teleterra.c diff --git a/src/ao_log.c b/src/ao_log.c index 19bfdfb8..7945ace4 100644 --- a/src/ao_log.c +++ b/src/ao_log.c @@ -109,6 +109,9 @@ ao_log_dump_next(void) __xdata uint8_t ao_log_adc_pos; __xdata enum flight_state ao_log_state; +/* a hack to make sure that ao_log_records fill the eeprom block in even units */ +typedef uint8_t check_log_size[1-(256 % sizeof(struct ao_log_record))] ; + void ao_log(void) { diff --git a/src/ao_teledongle.c b/src/ao_teledongle.c index 4ebc53a5..d7b4b75a 100644 --- a/src/ao_teledongle.c +++ b/src/ao_teledongle.c @@ -33,7 +33,6 @@ main(void) ao_monitor_init(AO_LED_GREEN, TRUE); ao_rssi_init(AO_LED_RED); ao_radio_init(); - ao_dbg_init(); ao_config_init(); ao_start_scheduler(); } diff --git a/src/ao_telemetrum.c b/src/ao_telemetrum.c index 5e951b49..1dbacf89 100644 --- a/src/ao_telemetrum.c +++ b/src/ao_telemetrum.c @@ -41,7 +41,6 @@ main(void) ao_telemetry_init(); ao_radio_init(); ao_igniter_init(); - ao_dbg_init(); ao_config_init(); ao_start_scheduler(); } diff --git a/src/ao_teleterra.c b/src/ao_teleterra.c index 6464ccc0..deb63597 100644 --- a/src/ao_teleterra.c +++ b/src/ao_teleterra.c @@ -34,7 +34,6 @@ main(void) ao_gps_init(); ao_monitor_init(AO_LED_GREEN, TRUE); ao_radio_init(); - ao_dbg_init(); ao_config_init(); ao_start_scheduler(); } -- cgit v1.2.3