Rev 728 | Rev 766 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 728 | Rev 761 | ||
---|---|---|---|
Line 24... | Line 24... | ||
24 | #include "osd_fcmode_default.h" |
24 | #include "osd_fcmode_default.h" |
Line 25... | Line 25... | ||
25 | 25 | ||
Line 26... | Line 26... | ||
26 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
26 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
27 | 27 | ||
28 | int osd_fcmode_default() { |
28 | int osd_fcmode_default() { |
29 | if (COSD_FLAGS_MODES & COSD_FLAG_HUD) { |
29 | if (COSD_FLAGS_MODES & COSD_FLAG_HUD) { |
30 | // write icons at init or after menu/mode-switch |
30 | // write icons at init or after menu/mode-switch |
31 | if (!(COSD_FLAGS_RUNTIME & COSD_ICONS_WRITTEN)) { |
31 | if (!(COSD_FLAGS_RUNTIME & COSD_ICONS_WRITTEN)) { |
32 | write_char_xy(10, top_line, 0xCA); // RC-transmitter |
32 | write_char_xy(10, top_line, 0xCA); // RC-transmitter |
33 | write_char_xy(27, top_line, 0xCC); // small meters m height |
33 | write_char_xy(27, top_line, 0xCC); // small meters m height |
34 | write_char_xy(7, bottom_line, 0x9E); // small v |
34 | write_char_xy(7, bottom_line, 0x9E); // small v |
35 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
35 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
36 | write_char_xy(7, bottom_line - 1, 0x9F); // small A |
36 | write_char_xy(7, bottom_line - 1, 0x9F); // small A |
37 | write_char_xy(14, bottom_line - 1, 0xB5); // mah |
37 | write_char_xy(14, bottom_line - 1, 0xB5); // mah |
38 | if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) { |
38 | if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) { |
39 | write_char_xy(21, bottom_line - 1, 0x9E); // small V |
39 | write_char_xy(21, bottom_line - 1, 0x9E); // small V |
40 | } |
40 | } |
41 | } |
41 | } |
42 | COSD_FLAGS_RUNTIME |= COSD_ICONS_WRITTEN; |
42 | COSD_FLAGS_RUNTIME |= COSD_ICONS_WRITTEN; |
43 | } |
43 | } |
44 | 44 | ||
45 | write_ndigit_number_u(7, top_line, debugData.Analog[10], 3, 0); |
45 | write_ndigit_number_u(7, top_line, debugData.Analog[10], 3, 0); |
46 | if (debugData.Analog[10] <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) { |
46 | if (debugData.Analog[10] <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) { |
47 | for (uint8_t x = 0; x < 4; x++) |
47 | for (uint8_t x = 0; x < 4; x++) |
48 | write_char_att_xy(7 + x, top_line, BLINK); |
48 | write_char_att_xy(7 + x, top_line, BLINK); |
49 | } else if (debugData.Analog[10] > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) { |
49 | } else if (debugData.Analog[10] > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) { |
50 | for (uint8_t x = 0; x < 4; x++) |
50 | for (uint8_t x = 0; x < 4; x++) |
51 | write_char_att_xy(7 + x, top_line, 0); |
51 | write_char_att_xy(7 + x, top_line, 0); |
52 | } |
52 | } |
53 | 53 | ||
54 | if (debugData.Analog[5] > 300 || debugData.Analog[5] < -300) { |
54 | if (debugData.Analog[5] > 300 || debugData.Analog[5] < -300) { |
55 | // above 10m only write full meters |
55 | // above 10m only write full meters |
56 | write_ndigit_number_s(23, top_line, debugData.Analog[5] / 30, 4, 0); |
56 | write_ndigit_number_s(23, top_line, debugData.Analog[5] / 30, 4, 0); |
57 | } else { |
57 | } else { |
58 | // up to 10m write meters.dm |
58 | // up to 10m write meters.dm |
59 | write_ndigit_number_s_10th(23, top_line, debugData.Analog[5] / 3, 3, 0); |
59 | write_ndigit_number_s_10th(23, top_line, debugData.Analog[5] / 3, 3, 0); |
60 | } |
60 | } |
61 | if (debugData.Analog[5] > max_Altimeter) max_Altimeter = debugData.Analog[5]; |
61 | if (debugData.Analog[5] > max_Altimeter) max_Altimeter = debugData.Analog[5]; |
62 | 62 | ||
63 | if (COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON) { |
63 | if (COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON) { |
64 | draw_artificial_horizon(top_line + 2, bottom_line - 1, debugData.Analog[0], debugData.Analog[1]); |
64 | draw_artificial_horizon(top_line + 2, bottom_line - 1, debugData.Analog[0], debugData.Analog[1]); |
65 | } |
65 | } |
66 | 66 | ||
67 | // pre-bottom line |
67 | // pre-bottom line |
68 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
68 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
69 | //write_ndigit_number_s(3, bottom_line - 1, ampere, 4, 0); |
69 | //write_ndigit_number_s(3, bottom_line - 1, ampere, 4, 0); |
70 | write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 3, 0); |
70 | write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 3, 0); |
71 | write_ndigit_number_s(10, bottom_line - 1, ampere_wasted / 10, 4, 0); |
71 | write_ndigit_number_s(10, bottom_line - 1, ampere_wasted / 10, 4, 0); |
72 | if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) { |
72 | if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) { |
73 | write_ndigit_number_u_10th(17, bottom_line - 1, s_volt, 3, 0); |
73 | write_ndigit_number_u_10th(17, bottom_line - 1, s_volt, 3, 0); |
74 | } |
74 | } |
75 | } |
75 | } |
76 | 76 | ||
77 | draw_battery(2, bottom_line, min_voltage, debugData.Analog[9], max_voltage); |
77 | draw_battery(2, bottom_line, min_voltage, debugData.Analog[9], max_voltage); |
78 | write_ndigit_number_u_10th(3, bottom_line, debugData.Analog[9], 3, 0); |
78 | write_ndigit_number_u_10th(3, bottom_line, debugData.Analog[9], 3, 0); |
79 | if (debugData.Analog[9] <= min_voltage && last_UBat > min_voltage) { |
79 | if (debugData.Analog[9] <= min_voltage && last_UBat > min_voltage) { |
80 | for (uint8_t x = 2; x < 8; x++) |
80 | for (uint8_t x = 2; x < 8; x++) |
81 | write_char_att_xy(x, bottom_line, BLINK); |
81 | write_char_att_xy(x, bottom_line, BLINK); |
82 | } else if (debugData.Analog[9] > min_voltage && last_UBat < min_voltage) { |
82 | } else if (debugData.Analog[9] > min_voltage && last_UBat < min_voltage) { |
83 | for (uint8_t x = 2; x < 8; x++) |
83 | for (uint8_t x = 2; x < 8; x++) |
84 | write_char_att_xy(x, bottom_line, 0); |
84 | write_char_att_xy(x, bottom_line, 0); |
85 | } |
85 | } |
86 | } |
86 | } |
87 | // remember last values |
87 | // remember last values |
88 | last_UBat = debugData.Analog[9]; |
88 | last_UBat = debugData.Analog[9]; |
89 | last_RC_Quality = debugData.Analog[10]; |
89 | last_RC_Quality = debugData.Analog[10]; |
90 | 90 | ||
91 | /* |
91 | /* |
92 | debugData.Analog[0]); // AngleNick |
92 | debugData.Analog[0]); // AngleNick |
93 | debugData.Analog[1]); // AngleRoll |
93 | debugData.Analog[1]); // AngleRoll |
94 | debugData.Analog[5]); // Height |
94 | debugData.Analog[5]); // Height |
95 | debugData.Analog[9]); // Voltage |
95 | debugData.Analog[9]); // Voltage |
96 | debugData.Analog[10]);// RC Signal |
96 | debugData.Analog[10]);// RC Signal |
97 | debugData.Analog[11]);// Gyro compass |
97 | debugData.Analog[11]);// Gyro compass |
Line 98... | Line 98... | ||
98 | */ |
98 | */ |
99 | seconds_since_last_data = 0; |
99 | seconds_since_last_data = 0; |
Line 100... | Line 100... | ||
100 | 100 |