Subversion Repositories Projects

Rev

Rev 932 | Rev 1197 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 932 Rev 941
Line 24... Line 24...
24
#include "osd_ncmode_default.h"
24
#include "osd_ncmode_default.h"
25
 
25
 
26
#if (!(ALLCHARSDEBUG || (WRITECHARS != -1)) && !FCONLY)
26
#if (!(ALLCHARSDEBUG || (WRITECHARS != -1)) && !FCONLY)
27
 
27
 
28
int osd_ncmode_default() {
28
int osd_ncmode_default() {
29
    uint8_t rc_signal = naviData.RC_RSSI ? naviData.RC_RSSI : naviData.RC_Quality; // if RSSI is present use it, else use Qality
-
 
30
 
-
 
31
    if (COSD_FLAGS_MODES & COSD_FLAG_HUD) {
29
    if (COSD_FLAGS_MODES & COSD_FLAG_HUD) {
32
        // write icons at init or after menu/mode-switch
30
        // write icons at init or after menu/mode-switch
33
        if (!(COSD_FLAGS_RUNTIME & COSD_ICONS_WRITTEN)) {
31
        if (!(COSD_FLAGS_RUNTIME & COSD_ICONS_WRITTEN)) {
34
            if (COSD_FLAGS_CONFIG & COSD_FLAG_FEET) {
32
            if (COSD_FLAGS_CONFIG & COSD_FLAG_FEET) {
35
                write_char_xy(5, top_line, 0x7D); // mph
33
                write_char_xy(5, top_line, 0x7D); // mph
Line 39... Line 37...
39
                write_char_xy(5, top_line, 0xCB); // km/h
37
                write_char_xy(5, top_line, 0xCB); // km/h
40
                write_char_xy(27, top_line + 1, 0xCC); // small meters m home
38
                write_char_xy(27, top_line + 1, 0xCC); // small meters m home
41
                write_char_xy(27, top_line, 0xCC); // small meters m height
39
                write_char_xy(27, top_line, 0xCC); // small meters m height
42
            }
40
            }
43
 
41
 
44
            write_char_xy(10, top_line, 0xCA); // RC-transmitter
-
 
45
            write_char_xy(16, top_line, 0xD0); // degree symbol
42
            write_char_xy(16, top_line, 0xD0); // degree symbol
46
 
43
 
47
            write_char_xy(20, top_line + 1, 0xB0); // left circle
44
            write_char_xy(20, top_line + 1, 0xB0); // left circle
48
            write_char_xy(22, top_line + 1, 0xB2); // right circle
45
            write_char_xy(22, top_line + 1, 0xB2); // right circle
49
 
46
 
50
 
-
 
51
            write_char_xy(7, bottom_line, 0x9E); // small V
47
            write_char_xy(7, bottom_line, 0x9E); // small V
52
            if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) || (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) {
48
            if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) || (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) {
53
                write_char_xy(7, bottom_line - 1, 0x9F); // small A
49
                write_char_xy(7, bottom_line - 1, 0x9F); // small A
54
                write_char_xy(14, bottom_line - 1, 0xB5); // mah
50
                write_char_xy(14, bottom_line - 1, 0xB5); // mah
55
                if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) {
51
                if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) {
Line 77... Line 73...
77
 
73
 
78
                draw_big_variometer(2, 8, (uint16_t)((uint32_t)naviData.GroundSpeed / (uint32_t)125));
74
                draw_big_variometer(2, 8, (uint16_t)((uint32_t)naviData.GroundSpeed / (uint32_t)125));
79
            }
75
            }
80
        }
76
        }
81
 
77
 
82
        write_ndigit_number_u(7, top_line, rc_signal, 3, 0);
78
        write_ndigit_number_u(7, top_line, naviData.RC_Quality, 3, 0);
83
        if (rc_signal <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) {
79
        if (naviData.RC_Quality <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) {
84
            for (uint8_t x = 0; x < 4; x++)
80
            for (uint8_t x = 0; x < 4; x++)
85
                write_char_att_xy(7 + x, top_line, BLINK);
81
                write_char_att_xy(7 + x, top_line, BLINK);
86
        } else if (rc_signal > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) {
82
        } else if (naviData.RC_Quality > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) {
87
            for (uint8_t x = 0; x < 4; x++)
83
            for (uint8_t x = 0; x < 4; x++)
88
                write_char_att_xy(7 + x, top_line, 0);
84
                write_char_att_xy(7 + x, top_line, 0);
89
        }
85
        }
90
 
86
 
-
 
87
        if (naviData.FCStatusFlags2 & FC_STATUS2_CAREFREE) {
-
 
88
            write_char_xy(10, top_line, 0x8F); // smiling CF transmitter
-
 
89
        } else {
-
 
90
            write_char_xy(10, top_line, 0xCA); // RC-transmitter
-
 
91
        }
-
 
92
 
91
 
93
 
92
        if (naviData.NCFlags & NC_FLAG_NOSERIALLINK) {
94
        if (naviData.NCFlags & NC_FLAG_NOSERIALLINK) {
93
            write_char_xy(11, top_line, 0); // clear
95
            write_char_xy(11, top_line, 0); // clear
94
        } else {
96
        } else {
95
            write_char_xy(11, top_line, 0xC6); // PC icon
97
            write_char_xy(11, top_line, 0xC6); // PC icon
Line 301... Line 303...
301
            if (naviData.Current * 10 > max_ampere) max_ampere = naviData.Current * 10;
303
            if (naviData.Current * 10 > max_ampere) max_ampere = naviData.Current * 10;
302
        }
304
        }
303
    }
305
    }
304
 
306
 
305
    // remember last values
307
    // remember last values
306
    last_RC_Quality = rc_signal;
308
    last_RC_Quality = naviData.RC_Quality;
307
    last_UBat = naviData.UBat;
309
    last_UBat = naviData.UBat;
308
    old_MKFlags = naviData.FCFlags;
310
    old_MKFlags = naviData.FCFlags;
309
    old_NCFlags = naviData.NCFlags;
311
    old_NCFlags = naviData.NCFlags;
310
    seconds_since_last_data = 0;
312
    seconds_since_last_data = 0;
311
 
313