Skip to content

Commit 1e30872

Browse files
committed
AP_Frsky_Telem: use alt getter/setter instead of member
Signed-off-by: Ryan Friedman <[email protected]>
1 parent e5fb6a1 commit 1e30872

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libraries/AP_Frsky_Telem/AP_Frsky_Backend.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ void AP_Frsky_Backend::calc_gps_position(void)
7777
AP_AHRS &_ahrs = AP::ahrs();
7878

7979
Location loc;
80-
8180
if (_ahrs.get_location(loc)) {
8281
float lat = format_gps(fabsf(loc.lat/10000000.0f));
8382
_SPort_data.latdddmm = lat;
@@ -89,7 +88,7 @@ void AP_Frsky_Backend::calc_gps_position(void)
8988
_SPort_data.lonmmmm = (lon - _SPort_data.londddmm) * 10000;
9089
_SPort_data.lon_ew = (loc.lng < 0) ? 'W' : 'E';
9190

92-
float alt = loc.alt * 0.01f;
91+
float alt = loc.get_alt_cm() * 0.01f;
9392
_SPort_data.alt_gps_meters = float_to_uint16(alt);
9493
_SPort_data.alt_gps_cm = float_to_uint16((alt - _SPort_data.alt_gps_meters) * 100);
9594

0 commit comments

Comments
 (0)