Rev 728 | Rev 736 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 728 | Rev 734 | ||
---|---|---|---|
Line 103... | Line 103... | ||
103 | uint16_t heading_home = (naviData.HomePositionDeviation.Bearing + 360 - naviData.CompassHeading) % 360; |
103 | uint16_t heading_home = (naviData.HomePositionDeviation.Bearing + 360 - naviData.CompassHeading) % 360; |
104 | //write_char_xy(21, top_line + 1, arrowdir[heading_conv(heading_home)]); |
104 | //write_char_xy(21, top_line + 1, arrowdir[heading_conv(heading_home)]); |
105 | // finer resolution, 0xa0 is first character and we add the index 0 <= index < 16 |
105 | // finer resolution, 0xa0 is first character and we add the index 0 <= index < 16 |
Line 106... | Line 106... | ||
106 | write_char_xy(21, top_line + 1, 0xa0 + heading_fine_conv(heading_home)); |
106 | write_char_xy(21, top_line + 1, 0xa0 + heading_fine_conv(heading_home)); |
107 | 107 | ||
108 | write_ndigit_number_u(24, top_line + 1, naviData.HomePositionDeviation.Distance / 10, 3, 0); |
108 | write_ndigit_number_u(24, top_line + 1, naviData.HomePositionDeviation.Distance / 10, 3, 0); |
109 | 109 | ||
110 | // center |
110 | // center |
111 | if (naviData.FCFlags & FLAG_MOTOR_RUN) { // should be engines running |
111 | if (naviData.FCFlags & FLAG_MOTOR_RUN) { // should be engines running |
112 | if (!(old_MKFlags & FLAG_MOTOR_RUN)) { // motors just started, clear middle |
112 | if (!(old_MKFlags & FLAG_MOTOR_RUN)) { // motors just started, clear middle |
113 | clear(); |
113 | clear(); |
- | 114 | // remember current heigth for gps offset |
|
- | 115 | altimeter_offset = naviData.CurrentPosition.Altitude / 1000; |
|
- | 116 | // set wasted counter to current offset |
|
- | 117 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
|
- | 118 | wasted_ampere_offset = ampere_wasted / 10; |
|
- | 119 | } else if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) { |
|
114 | // remember current heigth for gps offset |
120 | wasted_ampere_offset = naviData.UsedCapacity; |
115 | altimeter_offset = naviData.CurrentPosition.Altitude / 1000; |
121 | } |
116 | // update flags to paint display again if needed |
122 | // update flags to paint display again if needed |
117 | COSD_FLAGS_RUNTIME &= ~COSD_ICONS_WRITTEN; |
123 | COSD_FLAGS_RUNTIME &= ~COSD_ICONS_WRITTEN; |
118 | } |
124 | } |
Line 142... | Line 148... | ||
142 | write_ndigit_number_u_10th(18, line, min_UBat, 3, 0); |
148 | write_ndigit_number_u_10th(18, line, min_UBat, 3, 0); |
143 | write_char_xy(22, line, 0x9E); // small V |
149 | write_char_xy(22, line, 0x9E); // small V |
144 | 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)) { |
145 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[7])))); // ampere |
151 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[7])))); // ampere |
146 | write_ndigit_number_u_10th(18, line, max_ampere / 10, 3, 0); |
152 | write_ndigit_number_u_10th(18, line, max_ampere / 10, 3, 0); |
- | 153 | write_char_xy(22, line, 0x9F); // small A |
|
- | 154 | ||
- | 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)) { |
|
- | 157 | write_ndigit_number_u(23, line, (ampere_wasted / 10) - wasted_ampere_offset, 4, 0); |
|
- | 158 | } else if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) { |
|
- | 159 | ||
- | 160 | write_ndigit_number_u(23, line, naviData.UsedCapacity - wasted_ampere_offset, 4, 0); |
|
- | 161 | } |
|
- | 162 | ||
147 | write_char_xy(22, line, 0x9F); // small A |
163 | write_char_xy(27, line, 0xB5); // mah |
148 | } |
164 | } |
149 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[4])))); // max time |
165 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[4])))); // max time |
150 | write_time(16, line, max_FlyingTime); |
166 | write_time(16, line, max_FlyingTime); |
151 | write_char_xy(22, line, 210); // fly clock |
167 | write_char_xy(22, line, 210); // fly clock |