Rev 734 | Rev 753 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 734 | Rev 736 | ||
---|---|---|---|
Line 132... | Line 132... | ||
132 | // motors are on, assume we were/are flying |
132 | // motors are on, assume we were/are flying |
133 | COSD_FLAGS_RUNTIME |= COSD_WASFLYING; |
133 | COSD_FLAGS_RUNTIME |= COSD_WASFLYING; |
134 | } else { |
134 | } else { |
135 | // stats |
135 | // stats |
136 | if ((COSD_FLAGS_RUNTIME & COSD_WASFLYING) && (COSD_FLAGS_MODES & COSD_FLAG_STATS)) { |
136 | if ((COSD_FLAGS_RUNTIME & COSD_WASFLYING) && (COSD_FLAGS_MODES & COSD_FLAG_STATS)) { |
137 | uint8_t line = 3; |
137 | uint8_t line = 3; |
138 | write_ascii_string_pgm(2, line, (const char *) (pgm_read_word(&(stats_item_pointers[0])))); // max Altitude |
138 | write_ascii_string_pgm(1, line, (const char *) (pgm_read_word(&(stats_item_pointers[0])))); // max Altitude |
139 | write_ndigit_number_s(18, line, max_Altimeter, 4, 0); |
139 | write_ndigit_number_s(16, line, max_Altimeter, 4, 0); |
140 | write_char_xy(22, line, 204); // small meters m |
140 | write_char_xy(20, line, 204); // small meters m |
141 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[1])))); // max Speed |
141 | write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[1])))); // max Speed |
142 | write_ndigit_number_u(19, line, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 3, 0); |
142 | write_ndigit_number_u(17, line, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 3, 0); |
143 | write_char_xy(22, line, 203); // km/h |
143 | write_char_xy(20, line, 203); // km/h |
144 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[2])))); // max Distance |
144 | write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[2])))); // max Distance |
145 | write_ndigit_number_u(19, line, max_Distance / 10, 3, 0); |
145 | write_ndigit_number_u(17, line, max_Distance / 10, 3, 0); |
146 | write_char_xy(22, line, 204); // small meters m |
146 | write_char_xy(20, line, 204); // small meters m |
147 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[3])))); // min voltage |
147 | write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[3])))); // min voltage |
148 | write_ndigit_number_u_10th(18, line, min_UBat, 3, 0); |
148 | write_ndigit_number_u_10th(16, line, min_UBat, 3, 0); |
149 | write_char_xy(22, line, 0x9E); // small V |
149 | write_char_xy(20, line, 0x9E); // small V |
150 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) || (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
150 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) || (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
151 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[7])))); // ampere |
151 | write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[7])))); // ampere |
152 | write_ndigit_number_u_10th(18, line, max_ampere / 10, 3, 0); |
152 | write_ndigit_number_u_10th(16, line, max_ampere / 10, 3, 0); |
Line 153... | Line 153... | ||
153 | write_char_xy(22, line, 0x9F); // small A |
153 | write_char_xy(20, line, 0x9F); // small A |
154 | 154 | ||
155 | // wasted mampere in this flight (will count up after landing) |
155 | // wasted mampere in this flight (will count up after landing) |
156 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
156 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
Line 157... | Line 157... | ||
157 | write_ndigit_number_u(23, line, (ampere_wasted / 10) - wasted_ampere_offset, 4, 0); |
157 | write_ndigit_number_u(21, line, (ampere_wasted / 10) - wasted_ampere_offset, 5, 0); |
158 | } else if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) { |
158 | } else if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) { |
Line 159... | Line 159... | ||
159 | 159 | ||
160 | write_ndigit_number_u(23, line, naviData.UsedCapacity - wasted_ampere_offset, 4, 0); |
160 | write_ndigit_number_u(21, line, naviData.UsedCapacity - wasted_ampere_offset, 5, 0); |
161 | } |
161 | } |
162 | 162 | ||
163 | write_char_xy(27, line, 0xB5); // mah |
163 | write_char_xy(26, line, 0xB5); // mah |
164 | } |
164 | } |
165 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[4])))); // max time |
165 | write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[4])))); // max time |
166 | write_time(16, line, max_FlyingTime); |
166 | write_time(14, line, max_FlyingTime); |
167 | write_char_xy(22, line, 210); // fly clock |
167 | write_char_xy(20, line, 210); // fly clock |
168 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[5])))); // longitude |
168 | write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[5])))); // longitude |
169 | write_gps_pos(15, line, naviData.CurrentPosition.Longitude); |
169 | write_gps_pos(14, line, naviData.CurrentPosition.Longitude); |
170 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[6])))); // latitude |
170 | write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[6])))); // latitude |
171 | write_gps_pos(15, line, naviData.CurrentPosition.Latitude); |
171 | write_gps_pos(14, line, naviData.CurrentPosition.Latitude); |
172 | } else if (COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON) { // if no stats there is space horizon |
172 | } else if (COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON) { // if no stats there is space horizon |