From 851c4c02259a36b4d1905caf08916ca21319497d Mon Sep 17 00:00:00 2001 From: "bsongis@gmail.com" Date: Fri, 30 Aug 2013 18:02:00 +0000 Subject: [PATCH] [Taranis] Problem with SWR and Altitude in custom switches --- src/myeeprom.h | 8 +++++++- src/opentx.cpp | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/myeeprom.h b/src/myeeprom.h index 564dc1bf9..a53d57ff5 100644 --- a/src/myeeprom.h +++ b/src/myeeprom.h @@ -812,7 +812,13 @@ enum TelemetrySource { #else TELEM_DISPLAY_MAX = TELEM_TM2, // because used also in PlayValue #endif - TELEM_STATUS_MAX = TELEM_GPS_TIME + TELEM_STATUS_MAX = TELEM_GPS_TIME, +#if defined(FRSKY_SPORT) + TELEM_SWR = TELEM_RSSI_TX, + TELEM_FIRST_STREAMED_VALUE = TELEM_RSSI_RX, +#else + TELEM_FIRST_STREAMED_VALUE = TELEM_RSSI_TX, +#endif }; enum VarioSource { diff --git a/src/opentx.cpp b/src/opentx.cpp index f04f007f2..5936262a1 100644 --- a/src/opentx.cpp +++ b/src/opentx.cpp @@ -1006,7 +1006,7 @@ bool getSwitch(int8_t swtch) #if defined(FRSKY) // Telemetry if (cs->v1 >= MIXSRC_FIRST_TELEM) { - if ((!TELEMETRY_STREAMING() && cs->v1 >= MIXSRC_FIRST_TELEM+TELEM_TM2) || IS_FAI_FORBIDDEN(cs->v1-1)) + if ((!TELEMETRY_STREAMING() && cs->v1 >= MIXSRC_FIRST_TELEM+TELEM_FIRST_STREAMED_VALUE-1) || IS_FAI_FORBIDDEN(cs->v1-1)) return swtch > 0 ? false : true; #if defined (PCBTARANIS) @@ -1401,7 +1401,7 @@ getvalue_t convertTelemValue(uint8_t channel, uint8_t value) break; case TELEM_ALT: #if defined(PCBTARANIS) - result = value * 80 - 5000; + result = value * 800 - 50000; break; #endif case TELEM_GPSALT: