diff --git a/Telemetry.cpp b/Telemetry.cpp index aa6c4fe2..2f9a1da3 100644 --- a/Telemetry.cpp +++ b/Telemetry.cpp @@ -226,8 +226,12 @@ void inline send_GPS_speed(void) uint16_t Data_GPS_speed_ap; uint16_t temp; if (f.GPS_FIX && GPS_numSat >= 4) { - temp = (GPS_speed * 40 + 102) / 203; // FRSKY specific format in knots => factor ~50 (102 for rounding purpose) - Data_GPS_speed_bp = temp / 10; + #if defined KILOMETER_HOUR // OPENTX specific format in kilometers per hour => factor 36/100 (will be devided by 10 later) + temp = (GPS_speed * 36) / 10; + #else // FRSKY specific format in knots => factor ~50 (will be devided by 10 later) + temp = (GPS_speed * 40) / 203; + #endif + Data_GPS_speed_bp = temp / 10; // here comes the devision by 10 Data_GPS_speed_ap = temp - Data_GPS_speed_bp * 10; sendDataHead(ID_GPS_speed_bp); write_FrSky16(Data_GPS_speed_bp); diff --git a/config.h b/config.h index 92dce2c3..dffdfa1e 100644 --- a/config.h +++ b/config.h @@ -880,26 +880,30 @@ Also note, that maqgnetic declination changes with time, so recheck your value e /********************************************************************/ /**** TELEMETRY ****/ /********************************************************************/ + // select one of the two protocols depending on your receiver //#define FRSKY_TELEMETRY // used for FRSKY twoway receivers with telemetry (D-series like D8R-II or D8R-XP) // VBAT, Baro, MAG, GPS and POWERMETER are helpful // VBAT_CELLS is optional for a forth screen on the display FLD-02 //#define SPORT_TELEMETRY // for FRSKY twoway receivers with S.PORT telemetry (S-series like X4R/X6R/X8R), not implemented yet - TO BE DONE - // A2 voltage is represented by a value in the range 0-255. - // So if you set the max for A2 to be 12.4 each step will increase the displayed voltage by ~0.0486 - #define FRSKY_SPORT_A2_MAX 124 // NOTE: VBAT gets stored as an integer. 16 would be 1.6V, 124 is 12.4V, etc etc - + // FRSKY common entries - valid for both protocols #define TELEMETRY_SERIAL 3 // change if required - #define COORDFORMAT_DECIMALMINUTES // uncomment to get the format DD°MM.mmmm for the coordinates - comment out to get the format DD.dddddd° for the coordinates + + // FRSKY standard telemetry specific devices #define FRSKY_FLD02 // send only data specific for the FRSKY display FLD-02 - // comment out for OpenTX and Er9x, all data will be sent via FRSKY protocol //#define OPENTX // send OpenTX specific data - //#define ER9X // send Er9x specific data, not implemented yet - TO BE DONE FOR THE FUTURE + + // FRSKY standard telemetry specific selections + //#define COORDFORMAT_DECIMALMINUTES // uncomment to get the format DD°MM.mmmm for the coordinates - comment out to get the format DD.dddddd° for the coordinates + //#define KILOMETER_HOUR // send speed in kilometers per hour instead of knots (default) - requested by OPENTX #define TELEMETRY_ALT_BARO // send BARO based altitude, calibrated to 0 when arming, recommended if BARO available //#define TELEMETRY_ALT_GPS // send GPS based altitude (altitude above see level), for FLD-02 don't use together with TELEMETRY_ALT_BARO #define TELEMETRY_COURSE_MAG // send MAG based course/heading, recommended if MAG available, but FLD-02 does not display //#define TELEMETRY_COURSE_GPS // send GPS based course/heading, don't use together with TELEMETRY_COURSE_MAG, FLD-02 does not display + // S.PORT specific entries + #define FRSKY_SPORT_A2_MAX 124 // A2 voltage is represented by a value in the range 0-255. A value of 16 results in 1.6V, 124 is 12.4V, etc + /********************************************************************/ /**** Buzzer ****/ /********************************************************************/