mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 07:15:18 +03:00
Smart Port telemetry GPS ground speed unit is not applicable. (#2166)
Second try
This commit is contained in:
parent
9124c496b6
commit
1296169091
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue