diff options
author | Simon Wilks <sjwilks@gmail.com> | 2013-06-04 00:52:48 +0200 |
---|---|---|
committer | Simon Wilks <sjwilks@gmail.com> | 2013-06-04 00:52:48 +0200 |
commit | 9374e4b1f221d571d56686d7d92ecb6cabcca8b6 (patch) | |
tree | 3ee95c0bd42c81d49526883915f354b92a370622 | |
parent | 30d17cf0ba9da7587a2087674c37cda5399ab851 (diff) | |
download | px4-firmware-9374e4b1f221d571d56686d7d92ecb6cabcca8b6.tar.gz px4-firmware-9374e4b1f221d571d56686d7d92ecb6cabcca8b6.tar.bz2 px4-firmware-9374e4b1f221d571d56686d7d92ecb6cabcca8b6.zip |
Formatting and comments
-rw-r--r-- | src/drivers/hott_telemetry/messages.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/drivers/hott_telemetry/messages.c b/src/drivers/hott_telemetry/messages.c index e10a22dc4..369070f8c 100644 --- a/src/drivers/hott_telemetry/messages.c +++ b/src/drivers/hott_telemetry/messages.c @@ -52,8 +52,6 @@ /* The board is very roughly 5 deg warmer than the surrounding air */ #define BOARD_TEMP_OFFSET_DEG 5 -#define ALT_OFFSET 500.0f - static int battery_sub = -1; static int gps_sub = -1; static int home_sub = -1; @@ -146,7 +144,7 @@ build_gps_response(uint8_t *buffer, size_t *size) /* Get latitude in degrees, minutes and seconds */ double lat = ((double)(gps.lat))*1e-7d; - /* Prepend N or S specifier */ + /* Set the N or S specifier */ msg.latitude_ns = 0; if (lat < 0) { msg.latitude_ns = 1; @@ -168,7 +166,7 @@ build_gps_response(uint8_t *buffer, size_t *size) /* Get longitude in degrees, minutes and seconds */ double lon = ((double)(gps.lon))*1e-7d; - /* Prepend E or W specifier */ + /* Set the E or W specifier */ msg.longitude_ew = 0; if (lon < 0) { msg.longitude_ew = 1; @@ -185,7 +183,7 @@ build_gps_response(uint8_t *buffer, size_t *size) msg.longitude_sec_H = (uint8_t)(lon_sec >> 8) & 0xff; /* Altitude */ - uint16_t alt = (uint16_t)(gps.alt*1e-3 + ALT_OFFSET ); + uint16_t alt = (uint16_t)(gps.alt*1e-3 + 500.0f); msg.altitude_L = (uint8_t)alt & 0xff; msg.altitude_H = (uint8_t)(alt >> 8) & 0xff; |