From 506bc9b6ae4005deadf88f0207524ba2333c4c8d Mon Sep 17 00:00:00 2001 From: bsongis Date: Tue, 15 Apr 2014 18:11:13 +0200 Subject: [PATCH] AirSpeed now in Knots (and converted to km/h and mph according to Tx settings). Tests needed (LCD and audio) --- radio/src/lcd.cpp | 4 ++++ radio/src/opentx.cpp | 5 ++++- radio/src/telemetry/frsky_sport.cpp | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/radio/src/lcd.cpp b/radio/src/lcd.cpp index 4334da644..95926954a 100644 --- a/radio/src/lcd.cpp +++ b/radio/src/lcd.cpp @@ -1249,6 +1249,10 @@ void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val, putsTelemetryValue(x, y, div10_and_round(val), UNIT_RAW, att|PREC1); break; + case TELEM_ASPD-1: + putsTelemetryValue(x, y, val, UNIT_KTS, att); + break; + #if defined(CPUARM) case TELEM_SWR-1: #endif diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 492763e6e..095d2a60c 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -3314,10 +3314,13 @@ PLAY_FUNCTION(playValue, uint8_t idx) break; case MIXSRC_FIRST_TELEM+TELEM_VSPD-1: - case MIXSRC_FIRST_TELEM+TELEM_ASPD-1: PLAY_NUMBER(div10_and_round(val), 1+UNIT_METERS_PER_SECOND, PREC1); break; + case MIXSRC_FIRST_TELEM+TELEM_ASPD-1: + PLAY_NUMBER(val, 1+UNIT_KTS, 0); + break; + case MIXSRC_FIRST_TELEM+TELEM_CONSUMPTION-1: PLAY_NUMBER(val, 1+UNIT_MAH, 0); break; diff --git a/radio/src/telemetry/frsky_sport.cpp b/radio/src/telemetry/frsky_sport.cpp index c601a0a61..0d61587a6 100644 --- a/radio/src/telemetry/frsky_sport.cpp +++ b/radio/src/telemetry/frsky_sport.cpp @@ -791,6 +791,8 @@ void resetTelemetry() frskyData.hub.gpsSpeed_bp = 100; frskyData.hub.gpsSpeed_ap = 50; + frskyData.hub.airSpeed = 100; + frskyData.hub.cellsCount = 6; frskyData.hub.baroAltitudeOffset = 500 * 100;