Rev 499 | Rev 523 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 499 | Rev 519 | ||
---|---|---|---|
Line 40... | Line 40... | ||
40 | write_char_xy(27, bottom_line, 0xC9); // sat2 |
40 | write_char_xy(27, bottom_line, 0xC9); // sat2 |
41 | COSD_FLAGS2 |= COSD_ICONS_WRITTEN; |
41 | COSD_FLAGS2 |= COSD_ICONS_WRITTEN; |
42 | } |
42 | } |
Line 43... | Line 43... | ||
43 | 43 | ||
44 | // first line |
44 | // first line |
Line 45... | Line 45... | ||
45 | write_ndigit_number_u(1, top_line, (uint16_t) (((uint32_t) naviData.GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 100, 0); |
45 | write_ndigit_number_u(1, top_line, (uint16_t) (((uint32_t) naviData.GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 3, 0); |
Line 46... | Line 46... | ||
46 | 46 | ||
47 | write_ndigit_number_u(12, top_line, naviData.HomePositionDeviation.Distance / 10, 100, 0); |
47 | write_ndigit_number_u(12, top_line, naviData.HomePositionDeviation.Distance / 10, 3, 0); |
Line 48... | Line 48... | ||
48 | 48 | ||
49 | uint16_t heading_home = (naviData.HomePositionDeviation.Bearing + 360 - naviData.CompassHeading) % 360; |
49 | uint16_t heading_home = (naviData.HomePositionDeviation.Bearing + 360 - naviData.CompassHeading) % 360; |
50 | write_char_xy(17, top_line, 0xa0 + heading_fine_conv(heading_home)); |
50 | write_char_xy(17, top_line, 0xa0 + heading_fine_conv(heading_home)); |
51 | 51 | ||
52 | if (naviData.Altimeter > 300 || naviData.Altimeter < -300) { |
52 | if (naviData.Altimeter > 300 || naviData.Altimeter < -300) { |
53 | // above 10m only write full meters |
53 | // above 10m only write full meters |
54 | write_ndigit_number_s(22, top_line, naviData.Altimeter / 30, 1000, 0); |
54 | write_ndigit_number_s(22, top_line, naviData.Altimeter / 30, 4, 0); |
Line 55... | Line 55... | ||
55 | } else { |
55 | } else { |
Line 79... | Line 79... | ||
79 | } else { |
79 | } else { |
80 | // stats |
80 | // stats |
81 | if ((COSD_FLAGS2 & COSD_WASFLYING) && (COSD_FLAGS & COSD_FLAG_STATS)) { |
81 | if ((COSD_FLAGS2 & COSD_WASFLYING) && (COSD_FLAGS & COSD_FLAG_STATS)) { |
82 | uint8_t line = 3; |
82 | uint8_t line = 3; |
83 | write_ascii_string_pgm(2, line, (const char *) (pgm_read_word(&(stats_item_pointers[0])))); // max Altitude |
83 | write_ascii_string_pgm(2, line, (const char *) (pgm_read_word(&(stats_item_pointers[0])))); // max Altitude |
84 | write_ndigit_number_s(18, line, max_Altimeter / 30, 1000, 0); |
84 | write_ndigit_number_s(18, line, max_Altimeter / 30, 4, 0); |
85 | write_char_xy(22, line, 204); // small meters m |
85 | write_char_xy(22, line, 204); // small meters m |
86 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[1])))); // max Speed |
86 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[1])))); // max Speed |
87 | write_ndigit_number_u(19, line, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 100, 0); |
87 | write_ndigit_number_u(19, line, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 3, 0); |
88 | write_char_xy(22, line, 203); // km/h |
88 | write_char_xy(22, line, 203); // km/h |
89 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[2])))); // max Distance |
89 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[2])))); // max Distance |
90 | write_ndigit_number_u(19, line, max_Distance / 10, 100, 0); |
90 | write_ndigit_number_u(19, line, max_Distance / 10, 3, 0); |
91 | write_char_xy(22, line, 204); // small meters m |
91 | write_char_xy(22, line, 204); // small meters m |
92 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[3])))); // min voltage |
92 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[3])))); // min voltage |
93 | write_ndigit_number_u_10th(18, line, min_UBat, 100, 0); |
93 | write_ndigit_number_u_10th(18, line, min_UBat, 3, 0); |
94 | write_char_xy(22, line, 0x9E); // small V |
94 | write_char_xy(22, line, 0x9E); // small V |
95 | if (COSD_FLAGS2 & COSD_FLAG_STROMREC) { |
95 | if (COSD_FLAGS2 & COSD_FLAG_STROMREC) { |
96 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[7])))); // ampere |
96 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[7])))); // ampere |
97 | write_ndigit_number_u_10th(18, line, max_ampere / 10, 100, 0); |
97 | write_ndigit_number_u_10th(18, line, max_ampere / 10, 3, 0); |
98 | write_char_xy(22, line, 0x9F); // small A |
98 | write_char_xy(22, line, 0x9F); // small A |
99 | } |
99 | } |
100 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[4])))); // max time |
100 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[4])))); // max time |
101 | write_time(16, line, max_FlyingTime); |
101 | write_time(16, line, max_FlyingTime); |
102 | write_char_xy(22, line, 210); // fly clock |
102 | write_char_xy(22, line, 210); // fly clock |
Line 116... | Line 116... | ||
116 | draw_big_variometer(27, 8, naviData.Variometer); |
116 | draw_big_variometer(27, 8, naviData.Variometer); |
117 | } |
117 | } |
Line 118... | Line 118... | ||
118 | 118 | ||
119 | // pre-bottom line |
119 | // pre-bottom line |
120 | if (COSD_FLAGS2 & COSD_FLAG_STROMREC) { |
120 | if (COSD_FLAGS2 & COSD_FLAG_STROMREC) { |
121 | //write_ndigit_number_s(3, bottom_line - 1, ampere, 1000, 0); |
121 | //write_ndigit_number_s(3, bottom_line - 1, ampere, 4, 0); |
122 | write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 100, 0); |
122 | write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 3, 0); |
123 | write_ndigit_number_s(10, bottom_line - 1, ampere_wasted / 10, 1000, 0); |
123 | write_ndigit_number_s(10, bottom_line - 1, ampere_wasted / 10, 4, 0); |
Line 124... | Line 124... | ||
124 | } |
124 | } |
125 | 125 | ||
126 | // bottom line |
126 | // bottom line |
127 | draw_battery(2, bottom_line, min_voltage, naviData.UBat, max_voltage); |
127 | draw_battery(2, bottom_line, min_voltage, naviData.UBat, max_voltage); |
128 | write_ndigit_number_u_10th(3, bottom_line, naviData.UBat, 100, 0); |
128 | write_ndigit_number_u_10th(3, bottom_line, naviData.UBat, 3, 0); |
129 | if (naviData.UBat <= min_voltage && last_UBat > min_voltage) { |
129 | if (naviData.UBat <= min_voltage && last_UBat > min_voltage) { |
130 | for (uint8_t x = 2; x < 8; x++) |
130 | for (uint8_t x = 2; x < 8; x++) |
131 | write_char_att_xy(x, bottom_line, BLINK); |
131 | write_char_att_xy(x, bottom_line, BLINK); |
132 | } else if (naviData.UBat > min_voltage && last_UBat < min_voltage) { |
132 | } else if (naviData.UBat > min_voltage && last_UBat < min_voltage) { |
133 | for (uint8_t x = 2; x < 8; x++) |
133 | for (uint8_t x = 2; x < 8; x++) |
Line 134... | Line 134... | ||
134 | write_char_att_xy(x, bottom_line, 0); |
134 | write_char_att_xy(x, bottom_line, 0); |
Line 135... | Line 135... | ||
135 | } |
135 | } |
Line 136... | Line 136... | ||
136 | 136 | ||
137 | write_time(11, bottom_line, naviData.FlyingTime); |
137 | write_time(11, bottom_line, naviData.FlyingTime); |
138 | 138 | ||
139 | write_ndigit_number_u(24, bottom_line, naviData.SatsInUse, 10, 0); |
139 | write_ndigit_number_u(24, bottom_line, naviData.SatsInUse, 2, 0); |