Rev 2099 | Rev 2598 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2099 | Rev 2225 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /**************************************************************************** |
1 | /**************************************************************************** |
2 | * Copyright (C) 2009-2015 by Claas Anders "CaScAdE" Rathje * |
2 | * Copyright (C) 2009-2016 by Claas Anders "CaScAdE" Rathje * |
3 | * admiralcascade@gmail.com * |
3 | * admiralcascade@gmail.com * |
4 | * Project-URL: http://www.mylifesucks.de/oss/c-osd/ * |
4 | * Project-URL: http://www.mylifesucks.de/oss/c-osd/ * |
5 | * * |
5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * |
6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License as published by * |
7 | * it under the terms of the GNU General Public License as published by * |
Line 49... | Line 49... | ||
49 | write_ndigit_number_u(12, top_line, naviData.HomePositionDeviation.Distance / 10, 3, 0); |
49 | write_ndigit_number_u(12, top_line, naviData.HomePositionDeviation.Distance / 10, 3, 0); |
Line 50... | Line 50... | ||
50 | 50 | ||
51 | uint16_t heading_home = (naviData.HomePositionDeviation.Bearing + 360 - naviData.CompassHeading) % 360; |
51 | uint16_t heading_home = (naviData.HomePositionDeviation.Bearing + 360 - naviData.CompassHeading) % 360; |
Line 52... | Line 52... | ||
52 | write_char_xy(17, top_line, 0xa0 + heading_fine_conv(heading_home)); |
52 | write_char_xy(17, top_line, 0xa0 + heading_fine_conv(heading_home)); |
53 | 53 | ||
54 | if (naviData.Altimeter > 200 || naviData.Altimeter < -200) { |
54 | if (naviData.Altimeter_5cm > 200 || naviData.Altimeter_5cm < -200) { |
55 | // above 10m only write full meters |
55 | // above 10m only write full meters |
56 | write_ndigit_number_s(22, top_line, naviData.Altimeter / 20, 4, 0); |
56 | write_ndigit_number_s(22, top_line, naviData.Altimeter_5cm / 20, 4, 0); |
57 | } else { |
57 | } else { |
58 | // up to 10m write meters.dm |
58 | // up to 10m write meters.dm |
Line 59... | Line 59... | ||
59 | write_ndigit_number_s_10th(22, top_line, naviData.Altimeter / 2, 3, 0); |
59 | write_ndigit_number_s_10th(22, top_line, naviData.Altimeter_5cm / 2, 3, 0); |
Line 122... | Line 122... | ||
122 | // remember statistics (only when engines running) |
122 | // remember statistics (only when engines running) |
123 | if (naviData.FCStatusFlags & FCFLAG_MOTOR_RUN) { |
123 | if (naviData.FCStatusFlags & FCFLAG_MOTOR_RUN) { |
124 | if (COSD_FLAGS_CONFIG & COSD_FLAG_GPSHEIGHT) { |
124 | if (COSD_FLAGS_CONFIG & COSD_FLAG_GPSHEIGHT) { |
125 | if (naviData.CurrentPosition.Altitude / 1000 - altimeter_offset > max_Altimeter) max_Altimeter = naviData.CurrentPosition.Altitude / 1000; |
125 | if (naviData.CurrentPosition.Altitude / 1000 - altimeter_offset > max_Altimeter) max_Altimeter = naviData.CurrentPosition.Altitude / 1000; |
126 | } else { |
126 | } else { |
127 | if (naviData.Altimeter / 20 > max_Altimeter) max_Altimeter = naviData.Altimeter / 20; |
127 | if (naviData.Altimeter_5cm / 20 > max_Altimeter) max_Altimeter = naviData.Altimeter_5cm / 20; |
128 | } |
128 | } |
129 | if (naviData.GroundSpeed > max_GroundSpeed) max_GroundSpeed = naviData.GroundSpeed; |
129 | if (naviData.GroundSpeed > max_GroundSpeed) max_GroundSpeed = naviData.GroundSpeed; |
130 | if (naviData.HomePositionDeviation.Distance > max_Distance) { |
130 | if (naviData.HomePositionDeviation.Distance > max_Distance) { |
131 | max_Distance = naviData.HomePositionDeviation.Distance; |
131 | max_Distance = naviData.HomePositionDeviation.Distance; |
132 | } |
132 | } |