summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/ao_monitor.c2
-rw-r--r--src/core/ao_telemetry.c4
-rw-r--r--src/drivers/ao_cc1120_CC1120.h2
3 files changed, 5 insertions, 3 deletions
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) {
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;
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 */