From b4be63627e146c7c868b5b3468d34880a561cfba Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 17 Jul 2012 20:44:55 -0700 Subject: altos: Megametrum ADC values are 12 bits, discard low 4 for telemetry We've only got space for 8 bits for the ADC values for pyro channels, discard the low 4 bits instead of the low 8 bits. Signed-off-by: Keith Packard --- src/core/ao_telemetry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/ao_telemetry.c b/src/core/ao_telemetry.c index 583a6636..52ac9489 100644 --- a/src/core/ao_telemetry.c +++ b/src/core/ao_telemetry.c @@ -138,9 +138,9 @@ ao_send_mega_data(void) telemetry.mega_data.v_batt = packet->adc.v_batt; telemetry.mega_data.v_pyro = packet->adc.v_pbatt; - /* XXX figure out right shift value; 4 might suffice */ + /* ADC range is 0-4095, so shift by four to save the high 8 bits */ for (i = 0; i < AO_ADC_NUM_SENSE; i++) - telemetry.mega_data.sense[i] = packet->adc.sense[i] >> 8; + telemetry.mega_data.sense[i] = packet->adc.sense[i] >> 4; telemetry.mega_data.ground_pres = ao_ground_pres; telemetry.mega_data.ground_accel = ao_ground_accel; -- cgit v1.2.3 From 9fd5e3c28fb0fd6da8641e7dd18b9912866d1b75 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 17 Jul 2012 21:06:07 -0700 Subject: altos: With debug cables disconnected, CC1120 seems happy at +16dBm Let's see how it goes... Signed-off-by: Keith Packard --- src/drivers/ao_cc1120_CC1120.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/drivers/ao_cc1120_CC1120.h b/src/drivers/ao_cc1120_CC1120.h index 5376afd5..44cca938 100644 --- a/src/drivers/ao_cc1120_CC1120.h +++ b/src/drivers/ao_cc1120_CC1120.h @@ -83,7 +83,7 @@ CC1120_RFEND_CFG1, 0x0f, /* RFEND Configuration, Reg 1 */ CC1120_RFEND_CFG0, 0x00, /* RFEND Configuration, Reg 0 */ // CC1120_PA_CFG2, 0x3f, /* Power Amplifier Configuration, Reg 2 */ - CC1120_PA_CFG2, 0x04, /* Power Amplifier Configuration, Reg 2 */ + CC1120_PA_CFG2, 0x3f, /* Power Amplifier Configuration, Reg 2 */ CC1120_PA_CFG1, 0x56, /* Power Amplifier Configuration, Reg 1 */ CC1120_PA_CFG0, 0x7b, /* Power Amplifier Configuration, Reg 0 */ CC1120_PKT_LEN, 0xff, /* Packet Length Configuration */ -- cgit v1.2.3 From a698cd68968fc0be5f96b1729cdea2f65d2ccbf6 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 17 Jul 2012 23:59:13 -0700 Subject: altos: Toggling telemetry monitoring would replay the telem queue Using the 'm' command to turn telem off and back on would end up going around the whole telemetry queue replaying everything there as the wait loop would exit when disabling monitoring even if the ring was empty. Signed-off-by: Keith Packard --- src/core/ao_monitor.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/core/ao_monitor.c b/src/core/ao_monitor.c index d492e32a..5876bef7 100644 --- a/src/core/ao_monitor.c +++ b/src/core/ao_monitor.c @@ -132,6 +132,8 @@ ao_monitor_put(void) ao_sleep(DATA_TO_XDATA(&ao_external_monitoring)); while (ao_monitor_tail == ao_monitor_head && ao_external_monitoring) ao_sleep(DATA_TO_XDATA(&ao_monitor_head)); + if (!ao_external_monitoring) + continue; m = &ao_monitor_ring[ao_monitor_tail]; ao_monitor_tail = ao_monitor_ring_next(ao_monitor_tail); switch (ao_monitoring) { -- cgit v1.2.3