From 70c9fc74a68fdb92569eb73295cfa154cf3768f4 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 18 Nov 2012 09:50:54 -0800 Subject: altos: Make Tm recovery mode set RF cal and callsign too This lets us connect to Tm even if someone messes up the RF calibration or callsign info Signed-off-by: Keith Packard --- src/core/ao_config.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/ao_config.c b/src/core/ao_config.c index e8ff95b7..e85ddcb4 100644 --- a/src/core/ao_config.c +++ b/src/core/ao_config.c @@ -144,8 +144,12 @@ _ao_config_get(void) } #if HAS_RADIO #if HAS_FORCE_FREQ - if (ao_force_freq) + if (ao_force_freq) { ao_config.frequency = 434550; + ao_config.radio_cal = ao_radio_cal; + ao_xmemcpy(&ao_config.callsign, CODE_TO_XDATA(AO_CONFIG_DEFAULT_CALLSIGN), + sizeof(AO_CONFIG_DEFAULT_CALLSIGN) - 1); + } #endif ao_config_set_radio(); #endif -- cgit v1.2.3 From c494eecc51f7d80e24e5db7af0021c56cb6871d4 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 18 Nov 2012 10:08:38 -0800 Subject: altoslib: MegaMetrum data telem packets have sensor data, not flight no Setting the seen_flight bit without a flight number leads to bogus file names Signed-off-by: Keith Packard --- altoslib/AltosTelemetryRecordMegaData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/altoslib/AltosTelemetryRecordMegaData.java b/altoslib/AltosTelemetryRecordMegaData.java index 16a7b80c..98b9f4c5 100644 --- a/altoslib/AltosTelemetryRecordMegaData.java +++ b/altoslib/AltosTelemetryRecordMegaData.java @@ -87,7 +87,7 @@ public class AltosTelemetryRecordMegaData extends AltosTelemetryRecordRaw { next.kalman_speed = speed / 16.0; next.kalman_height = height; - next.seen |= AltosRecord.seen_flight | AltosRecord.seen_temp_volt; + next.seen |= AltosRecord.seen_sensor | AltosRecord.seen_temp_volt; return next; } -- cgit v1.2.3 From fcb801b145e1ae6f1c0b3418a99245d34dbf5aa4 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 18 Nov 2012 10:10:29 -0800 Subject: altoslib: Allow flight number to be zero It's zero when there's no storage space on the device. Instead of waiting for non-zero flight number, wait for the seen_flight bit to be set in the telem tracking state Signed-off-by: Keith Packard --- altoslib/AltosLog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/altoslib/AltosLog.java b/altoslib/AltosLog.java index 1c7069ce..aa30190c 100644 --- a/altoslib/AltosLog.java +++ b/altoslib/AltosLog.java @@ -85,7 +85,7 @@ public class AltosLog implements Runnable { continue; try { AltosRecord telem = AltosTelemetry.parse(line.line, previous); - if (telem.serial != 0 && telem.flight != 0 && + if ((telem.seen & AltosRecord.seen_flight) != 0 && (telem.serial != serial || telem.flight != flight || log_file == null)) { close_log_file(); -- cgit v1.2.3 From c4737c81ee2da826b38cc52efbfb09017e6825ca Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 18 Nov 2012 10:13:49 -0800 Subject: altoslib: Reset telem tracking state when switching altimeters This discards any local state when the new telem packet has a different serial number Signed-off-by: Keith Packard --- altoslib/AltosTelemetryRecordRaw.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/altoslib/AltosTelemetryRecordRaw.java b/altoslib/AltosTelemetryRecordRaw.java index c21da6fc..51dd704d 100644 --- a/altoslib/AltosTelemetryRecordRaw.java +++ b/altoslib/AltosTelemetryRecordRaw.java @@ -62,7 +62,8 @@ public class AltosTelemetryRecordRaw extends AltosTelemetryRecord { public AltosRecord update_state(AltosRecord previous) { AltosRecord next; - if (previous != null) + + if (previous != null && previous.serial == serial) next = previous.clone(); else next = new AltosRecordNone(); -- cgit v1.2.3 From 1df3e6402489480e30600304bf024481902f9425 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 18 Nov 2012 10:15:14 -0800 Subject: altos: Clean everything, even if we don't have compilers This ensures that stale bits aren't left if PATH isn't set right when 'make clean' is called. Signed-off-by: Keith Packard --- src/Makefile | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/Makefile b/src/Makefile index 05075ae1..473cc60a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -13,8 +13,7 @@ vpath matrix.5c kalman include Version -ifneq ($(shell which sdcc),) - SUBDIRS+=\ +SDCCDIRS=\ telemetrum-v1.2 telemetrum-v1.1 telemetrum-v1.0 \ teledongle-v0.2 teledongle-v0.1 \ telemini-v1.0 telenano-v0.1 \ @@ -24,19 +23,30 @@ ifneq ($(shell which sdcc),) teleterra-v0.2 teleshield-v0.1 \ telefire-v0.1 \ spiradio-v0.1 + +AVRDIRS=\ + telescience-v0.1 telescience-pwm telepyro-v0.1 micropeak + +ARMDIRS=\ + megametrum-v0.1 megadongle-v0.1 stm-bringup stm-demo telelco-v0.1 + +ifneq ($(shell which sdcc),) + SUBDIRS += $(SDCCDIRS) endif ifneq ($(shell which avr-gcc),) - SUBDIRS += telescience-v0.1 telescience-pwm telepyro-v0.1 micropeak + SUBDIRS += $(AVRDIRS) endif ifneq ($(shell which arm-none-eabi-gcc),) - SUBDIRS += megametrum-v0.1 megadongle-v0.1 stm-bringup stm-demo telelco-v0.1 + SUBDIRS += $(ARMDIRS) endif +ALLDIRS=$(SDCCDIRS) $(AVRDIRS) $(ARMDIRS) + all: all-local all-recursive -RECURSIVE_TARGETS = all-recursive clean-recursive install-recursive +RECURSIVE_TARGETS = all-recursive install-recursive $(RECURSIVE_TARGETS): @target=`echo $@ | sed 's/-recursive//'`; \ @@ -45,6 +55,15 @@ $(RECURSIVE_TARGETS): (cd $$subdir && $(MAKE) $$target) || exit 1; \ done +ALL_RECURSIVE_TARGETS = clean-recursive + +$(ALL_RECURSIVE_TARGETS): + @target=`echo $@ | sed 's/-recursive//'`; \ + for subdir in $(ALLDIRS); do \ + echo "Making $$target in $$subdir"; \ + (cd $$subdir && $(MAKE) $$target) || exit 1; \ + done + distclean: clean clean: clean-local clean-recursive -- cgit v1.2.3 From ba3532a8ca7083b09fde5827faeb95f0c2f3b07c Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 18 Nov 2012 10:20:52 -0800 Subject: doc: Minor updates to the micropeak docs Mention light issue in quick start guide. Update run-time estimate to 40 hours (measured over 44 hours) Signed-off-by: Keith Packard --- doc/micropeak.xsl | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/doc/micropeak.xsl b/doc/micropeak.xsl index 556700c0..284d0fb0 100644 --- a/doc/micropeak.xsl +++ b/doc/micropeak.xsl @@ -30,6 +30,13 @@ Initial release with preliminary hardware. + + 1.0 + 18 November 2012 + + Updates for version 1.0 release. + + @@ -70,7 +77,8 @@ NAR #88757, TRA #12200 preparing a soft cushion of wadding inside a vented model payload bay. Wherever you mount it, make sure you protect the barometric sensor from corrosive ejection gasses as those - will damage the sensor. + will damage the sensor, and shield it from light as that can + cause incorrect sensor readings. @@ -115,8 +123,7 @@ NAR #88757, TRA #12200 - Recover the data. Turn MicroPeak off for a couple of seconds - (to discharge the capacitors) and then back on. MicroPeak + Recover the data. Turn MicroPeak off and then back on. MicroPeak will blink out the maximum height for the last flight. Turn MicroPeak back off to conserve battery power. @@ -141,14 +148,13 @@ NAR #88757, TRA #12200 to keep conductive material from coming in contact with the exposed metal elements. - The barometric sensors used in MicroPeak is - sensitive to sunlight. Please consider this when - designing an installation, for example, in an air-frame with a - see-through plastic payload bay. Many model rockets with payload bays - use clear plastic for the payload bay. Replacing these with an opaque - cardboard tube, painting them, or wrapping them with a layer of masking - tape are all reasonable approaches to keep the sensor out of direct - sunlight. + The barometric sensor used in MicroPeak is sensitive to + sunlight. Please consider this when designing an + installation. Many model rockets with payload bays use clear + plastic for the payload bay. Replacing these with an opaque + cardboard tube, painting them, or wrapping them with a layer of + masking tape are all reasonable approaches to keep the sensor + out of direct sunlight. The barometric sensor sampling ports must be able to "breathe", @@ -204,7 +210,7 @@ NAR #88757, TRA #12200 Lithium Battery The CR1025 battery used by MicroPeak holes 30mAh of power, - which is sufficient to run for over 15 hours. Because + which is sufficient to run for over 40 hours. Because MicroPeak powers down on landing, run time includes only time sitting on the launch pad or during flight. -- cgit v1.2.3 From 8ff0db3979405357003b52022e564a3da75ec3fb Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 18 Nov 2012 10:35:39 -0800 Subject: altos: micropeak LED is orange now, not blue Change the names around to match Signed-off-by: Keith Packard --- src/micropeak/ao_micropeak.c | 8 ++++---- src/micropeak/ao_pins.h | 7 ++++--- src/micropeak/ao_report_tiny.c | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/micropeak/ao_micropeak.c b/src/micropeak/ao_micropeak.c index bf656979..10e1d0f9 100644 --- a/src/micropeak/ao_micropeak.c +++ b/src/micropeak/ao_micropeak.c @@ -133,11 +133,11 @@ main(void) for (;;) { time += SAMPLE_SLEEP; if (sample_count == 0) - ao_led_on(AO_LED_BLUE); + ao_led_on(AO_LED_REPORT); ao_delay_until(time); ao_pa_get(); if (sample_count == 0) - ao_led_off(AO_LED_BLUE); + ao_led_off(AO_LED_REPORT); pa_avg = pa_avg - (pa_avg >> FILTER_SHIFT) + pa; pa_diff = pa_ground - pa_avg; @@ -172,10 +172,10 @@ main(void) time += SAMPLE_SLEEP; ao_delay_until(time); if ((sample_count & 3) == 0) - ao_led_on(AO_LED_BLUE); + ao_led_on(AO_LED_REPORT); ao_pa_get(); if ((sample_count & 3) == 0) - ao_led_off(AO_LED_BLUE); + ao_led_off(AO_LED_REPORT); #if HAS_EEPROM ao_log_micro_data(AO_LOG_MICRO_DATA | pa); #endif diff --git a/src/micropeak/ao_pins.h b/src/micropeak/ao_pins.h index 64f4444f..257b8694 100644 --- a/src/micropeak/ao_pins.h +++ b/src/micropeak/ao_pins.h @@ -19,10 +19,11 @@ #define _AO_PINS_H_ #include -#define AO_LED_BLUE (1<<4) +#define AO_LED_ORANGE (1<<4) #define AO_LED_SERIAL 4 -#define AO_LED_PANIC AO_LED_BLUE -#define LEDS_AVAILABLE (AO_LED_BLUE) +#define AO_LED_PANIC AO_LED_ORANGE +#define AO_LED_REPORT AO_LED_ORANGE +#define LEDS_AVAILABLE (AO_LED_ORANGE) #define USE_SERIAL_1_STDIN 0 #define HAS_USB 0 #define PACKET_HAS_SLAVE 0 diff --git a/src/micropeak/ao_report_tiny.c b/src/micropeak/ao_report_tiny.c index 5937508b..8b4960c6 100644 --- a/src/micropeak/ao_report_tiny.c +++ b/src/micropeak/ao_report_tiny.c @@ -17,7 +17,7 @@ #include -#define mid(time) ao_led_for(AO_LED_BLUE, time) +#define mid(time) ao_led_for(AO_LED_REPORT, time) #define pause(time) ao_delay(time) static void -- cgit v1.2.3 From 285fccfa82d89b0decc3b44f413eef9d0c8f1e63 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 18 Nov 2012 10:36:17 -0800 Subject: altos: Slow down micropeak report timing This makes reading the LED a lot easier. Signed-off-by: Keith Packard --- src/micropeak/ao_report_tiny.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/micropeak/ao_report_tiny.c b/src/micropeak/ao_report_tiny.c index 8b4960c6..109af1ed 100644 --- a/src/micropeak/ao_report_tiny.c +++ b/src/micropeak/ao_report_tiny.c @@ -25,14 +25,14 @@ ao_report_digit(uint8_t digit) __reentrant { if (!digit) { mid(AO_MS_TO_TICKS(600)); - pause(AO_MS_TO_TICKS(200)); + pause(AO_MS_TO_TICKS(300)); } else { while (digit--) { - mid(AO_MS_TO_TICKS(200)); - pause(AO_MS_TO_TICKS(200)); + mid(AO_MS_TO_TICKS(300)); + pause(AO_MS_TO_TICKS(300)); } } - pause(AO_MS_TO_TICKS(300)); + pause(AO_MS_TO_TICKS(600)); } void -- cgit v1.2.3