From e82a57cb34e29f12cacf90c29b1114f756548f7b Mon Sep 17 00:00:00 2001 From: Richard Meadows Date: Fri, 15 Jan 2016 20:38:17 +0000 Subject: [PATCH] [battery] Add 1.5V L91 battery voltage to uhf telemetry --- firmware/inc/hw_config.h | 5 +++-- firmware/src/main.c | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/firmware/inc/hw_config.h b/firmware/inc/hw_config.h index 5523d94..3318abf 100644 --- a/firmware/inc/hw_config.h +++ b/firmware/inc/hw_config.h @@ -139,11 +139,12 @@ /** * Battery ADC */ -#define BATTERY_ADC 0 +#define BATTERY_ADC 1 #define BATTERY_ADC_PIN PIN_PA02 #define BATTERY_ADC_PINMUX PINMUX_PA02B_ADC_AIN0 #define BATTERY_ADC_CHANNEL ADC_POSITIVE_INPUT_PIN0 -#define BATTERY_ADC_CHANNEL_DIV 0.3125 +#define BATTERY_ADC_CHANNEL_DIV 1 +/*0.3125*/ /** * External Thermistor ADC diff --git a/firmware/src/main.c b/firmware/src/main.c index 3bb3d6c..952c38b 100644 --- a/firmware/src/main.c +++ b/firmware/src/main.c @@ -69,15 +69,16 @@ uint16_t format_telemetry_string(char* string, struct tracker_datapoint* dp, /* sprintf - full string (approx 90 chars) */ len += sprintf(telemetry_string + len, - "%s,%02u:%02u:%02u,%02u%02u%02u,%02.5f,%03.5f,%ld,%u,%u,%ld,%.1f,%.1f,%.1f", + "%s,%02u:%02u:%02u,%02u%02u%02u,%02.5f,%03.5f,%ld,%u,%u,%ld,%.2f,%.1f,%.1f,%.1f", CALLSIGN, /* 2+6+2+1=11 */ dp->time.hour, dp->time.minute, dp->time.second, /* 2+1+2+1+2+1=9 */ dp->time.year%100, dp->time.month, dp->time.day, /* 2+2+2+1=7 */ lat_fmt, lon_fmt, altitude, dp->satillite_count, /* 3+1+5+1 + 4+1+5+1 + 5+1 + 2+1 = 30 */ dp->time_to_first_fix, dp->main_pressure, /* 2+1 + 5+1 = 9 */ - dp->thermistor_temperature, dp->bmp180_temperature, /* 3+1+1+1 + 3+1+1+1 = 12 */ + dp->battery, dp->thermistor_temperature, /* 1+1+2+1 + 3+1+1+1 = 11 */ + dp->bmp180_temperature, /* 3+1+1+1 = 6 */ dp->radio_die_temperature); /* 3+1+1+1 = 6 */ - /* sum = 84 (must be less than or equal to 114) */ + /* sum = 89 (must be less than or equal to 114) */ if (reduce_char_set) { /* Reduce character set */