1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-21 07:15:18 +03:00

Merge pull request #1464 from fredmcc/SmartportSpeedFix

Smart Port telemetry GPS ground speed unit is not applicable. (#2166)
This commit is contained in:
Martin Budden 2016-11-05 10:43:48 +01:00 committed by GitHub
commit abf519f46b

View file

@ -628,8 +628,10 @@ void handleSmartPortTelemetry(void)
#ifdef GPS #ifdef GPS
case FSSP_DATAID_SPEED : case FSSP_DATAID_SPEED :
if (sensors(SENSOR_GPS) && STATE(GPS_FIX)) { if (sensors(SENSOR_GPS) && STATE(GPS_FIX)) {
uint32_t tmpui = (GPS_speed * 36 + 36 / 2) / 100; //convert to knots: 1cm/s = 0.0194384449 knots
smartPortSendPackage(id, tmpui); // given in 0.1 m/s, provide in KM/H //Speed should be sent in knots/1000 (GPS speed is in cm/s)
uint32_t tmpui = GPS_speed * 1944 / 100;
smartPortSendPackage(id, tmpui);
smartPortHasRequest = 0; smartPortHasRequest = 0;
} }
break; break;