mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 16:41:36 +08:00
change baro altitude scaling to 100 to match OpenTX "custom" altitude
mode
This commit is contained in:
committed by
Lorenz Meier
parent
52ebbda5ac
commit
8d089d95d4
@@ -173,7 +173,9 @@ void sPort_send_CUR(int uart)
|
|||||||
sPort_send_data(uart, SMARTPORT_ID_CURR, current);
|
sPort_send_data(uart, SMARTPORT_ID_CURR, current);
|
||||||
}
|
}
|
||||||
|
|
||||||
// verified scaling for "calculated" altitude option
|
// verified scaling for "custom" altitude option
|
||||||
|
// OpenTX uses the initial reading as field elevation and displays
|
||||||
|
// the difference (altitude - field)
|
||||||
void sPort_send_ALT(int uart)
|
void sPort_send_ALT(int uart)
|
||||||
{
|
{
|
||||||
/* get a local copy of the current sensor values */
|
/* get a local copy of the current sensor values */
|
||||||
@@ -182,7 +184,7 @@ void sPort_send_ALT(int uart)
|
|||||||
orb_copy(ORB_ID(sensor_combined), sensor_sub, &raw);
|
orb_copy(ORB_ID(sensor_combined), sensor_sub, &raw);
|
||||||
|
|
||||||
/* send data */
|
/* send data */
|
||||||
uint32_t alt = (int)(10 * raw.baro_alt_meter[0]);
|
uint32_t alt = (int)(100 * raw.baro_alt_meter[0]);
|
||||||
sPort_send_data(uart, SMARTPORT_ID_ALT, alt);
|
sPort_send_data(uart, SMARTPORT_ID_ALT, alt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user