Rev 465 | Rev 468 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 465 | Rev 467 | ||
---|---|---|---|
Line 27... | Line 27... | ||
27 | write_char_xy(20, top_line + 1, 0xB0); // left circle |
27 | write_char_xy(20, top_line + 1, 0xB0); // left circle |
28 | write_char_xy(22, top_line + 1, 0xB2); // right circle |
28 | write_char_xy(22, top_line + 1, 0xB2); // right circle |
29 | write_char_xy(27, top_line + 1, 0xCC); // small meters m home |
29 | write_char_xy(27, top_line + 1, 0xCC); // small meters m home |
30 | write_char_xy(7, bottom_line, 0x9E); // small V |
30 | write_char_xy(7, bottom_line, 0x9E); // small V |
31 | if (COSD_FLAGS2 & COSD_FLAG_STROMREC) { |
31 | if (COSD_FLAGS2 & COSD_FLAG_STROMREC) { |
32 | write_char_xy(7, bottom_line, 0x9F); // small A |
32 | write_char_xy(7, bottom_line - 1, 0x9F); // small A |
33 | } |
33 | } |
34 | write_char_xy(14, bottom_line, 0xD1); // on clock |
34 | write_char_xy(14, bottom_line, 0xD1); // on clock |
35 | write_char_xy(21, bottom_line, 0xD2); // fly clock |
35 | write_char_xy(21, bottom_line, 0xD2); // fly clock |
36 | write_char_xy(26, bottom_line, 0xC8); // sat1 |
36 | write_char_xy(26, bottom_line, 0xC8); // sat1 |
37 | write_char_xy(27, bottom_line, 0xC9); // sat2 |
37 | write_char_xy(27, bottom_line, 0xC9); // sat2 |
Line 97... | Line 97... | ||
97 | // motors are on, assume we were/are flying |
97 | // motors are on, assume we were/are flying |
98 | COSD_FLAGS |= COSD_WASFLYING; |
98 | COSD_FLAGS |= COSD_WASFLYING; |
99 | } else { |
99 | } else { |
100 | // stats |
100 | // stats |
101 | if ((COSD_FLAGS & COSD_WASFLYING) && (COSD_FLAGS & COSD_FLAG_STATS)) { |
101 | if ((COSD_FLAGS & COSD_WASFLYING) && (COSD_FLAGS & COSD_FLAG_STATS)) { |
- | 102 | uint8_t line = 4; |
|
102 | write_ascii_string_pgm(2, 4, stats_item_pointers[0]); // max Altitude |
103 | write_ascii_string_pgm(2, line, stats_item_pointers[0]); // max Altitude |
103 | write_ndigit_number_s(18, 4, max_Altimeter / 30, 1000, 0); |
104 | write_ndigit_number_s(18, line, max_Altimeter / 30, 1000, 0); |
104 | write_char_xy(22, 4, 204); // small meters m |
105 | write_char_xy(22, line, 204); // small meters m |
105 | write_ascii_string_pgm(2, 5, stats_item_pointers[1]); // max Speed |
106 | write_ascii_string_pgm(2, ++line, stats_item_pointers[1]); // max Speed |
106 | write_ndigit_number_u(19, 5, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 100, 0); |
107 | write_ndigit_number_u(19, line, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 100, 0); |
107 | write_char_xy(22, 5, 203); // km/h |
108 | write_char_xy(22, line, 203); // km/h |
108 | write_ascii_string_pgm(2, 6, stats_item_pointers[2]); // max Distance |
109 | write_ascii_string_pgm(2, ++line, stats_item_pointers[2]); // max Distance |
109 | write_ndigit_number_u(19, 6, max_Distance / 10, 100, 0); |
110 | write_ndigit_number_u(19, line, max_Distance / 10, 100, 0); |
110 | write_char_xy(22, 6, 204); // small meters m |
111 | write_char_xy(22, line, 204); // small meters m |
111 | write_ascii_string_pgm(2, 7, stats_item_pointers[3]); // min voltage |
112 | write_ascii_string_pgm(2, ++line, stats_item_pointers[3]); // min voltage |
112 | write_ndigit_number_u_10th(18, 7, min_UBat, 100, 0); |
113 | write_ndigit_number_u_10th(18, line, min_UBat, 100, 0); |
113 | write_char_xy(22, 7, 0x9E); // small v |
114 | write_char_xy(22, line, 0x9E); // small v |
- | 115 | if (COSD_FLAGS2 & COSD_FLAG_STROMREC) { |
|
- | 116 | write_ascii_string_pgm(2, ++line, stats_item_pointers[7]); // ampere |
|
- | 117 | write_ndigit_number_u_10th(18, line, max_ampere / 10, 100, 0); |
|
- | 118 | write_char_xy(22, line, 0x9F); // small v |
|
- | 119 | } |
|
114 | write_ascii_string_pgm(2, 8, stats_item_pointers[4]); // max time |
120 | write_ascii_string_pgm(2, ++line, stats_item_pointers[4]); // max time |
115 | write_time(16, 8, max_FlyingTime); |
121 | write_time(16, line, max_FlyingTime); |
116 | write_char_xy(22, 8, 210); // fly clock |
122 | write_char_xy(22, line, 210); // fly clock |
117 | write_ascii_string_pgm(2, 9, stats_item_pointers[5]); // longitude |
123 | write_ascii_string_pgm(2, ++line, stats_item_pointers[5]); // longitude |
118 | write_gps_pos(15, 9, naviData.CurrentPosition.Longitude); |
124 | write_gps_pos(15, line, naviData.CurrentPosition.Longitude); |
119 | write_ascii_string_pgm(2, 10, stats_item_pointers[6]); // latitude |
125 | write_ascii_string_pgm(2, ++line, stats_item_pointers[6]); // latitude |
120 | write_gps_pos(15, 10, naviData.CurrentPosition.Latitude); |
126 | write_gps_pos(15, line, naviData.CurrentPosition.Latitude); |
121 | } else if (COSD_FLAGS & COSD_FLAG_ARTHORIZON) { // if no stats there is space horizon |
127 | } else if (COSD_FLAGS & COSD_FLAG_ARTHORIZON) { // if no stats there is space horizon |
122 | draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll); |
128 | draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll); |
123 | } |
129 | } |
124 | } |
130 | } |
125 | if (COSD_FLAGS & COSD_FLAG_BIGVARIO) { |
131 | if (COSD_FLAGS & COSD_FLAG_BIGVARIO) { |
126 | draw_big_variometer(27, 8, naviData.Variometer); |
132 | draw_big_variometer(27, 8, naviData.Variometer); |
127 | } |
133 | } |
Line 128... | Line 134... | ||
128 | 134 | ||
129 | // pre-bottom line |
135 | // pre-bottom line |
130 | if (COSD_FLAGS2 & COSD_FLAG_STROMREC) { |
136 | if (COSD_FLAGS2 & COSD_FLAG_STROMREC) { |
- | 137 | //write_ndigit_number_s(3, bottom_line - 1, ampere, 1000, 0); |
|
131 | write_ndigit_number_s(3, bottom_line - 1, ampere, 1000, 0); |
138 | write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 100, 0); |
Line 132... | Line 139... | ||
132 | } |
139 | } |
133 | 140 | ||
134 | // bottom line |
141 | // bottom line |
Line 173... | Line 180... | ||
173 | if (naviData.HomePositionDeviation.Distance > max_Distance) { |
180 | if (naviData.HomePositionDeviation.Distance > max_Distance) { |
174 | max_Distance = naviData.HomePositionDeviation.Distance; |
181 | max_Distance = naviData.HomePositionDeviation.Distance; |
175 | } |
182 | } |
176 | if (naviData.UBat < min_UBat) min_UBat = naviData.UBat; |
183 | if (naviData.UBat < min_UBat) min_UBat = naviData.UBat; |
177 | if (naviData.FlyingTime > max_FlyingTime) max_FlyingTime = naviData.FlyingTime; |
184 | if (naviData.FlyingTime > max_FlyingTime) max_FlyingTime = naviData.FlyingTime; |
- | 185 | if (ampere > max_ampere) max_ampere = ampere; |
|
178 | } |
186 | } |
Line 179... | Line 187... | ||
179 | 187 | ||
180 | old_MKFlags = naviData.MKFlags; |
188 | old_MKFlags = naviData.MKFlags; |