Subversion Repositories Projects

Rev

Rev 783 | Rev 952 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 783 Rev 902
Line 1... Line 1...
1
/****************************************************************************
1
/****************************************************************************
2
 *   Copyright (C) 2009-2010 by Claas Anders "CaScAdE" Rathje               *
2
 *   Copyright (C) 2009-2011 by Claas Anders "CaScAdE" Rathje               *
3
 *   admiralcascade@gmail.com                                               *
3
 *   admiralcascade@gmail.com                                               *
4
 *   Project-URL: http://www.mylifesucks.de/oss/c-osd/                      *
4
 *   Project-URL: http://www.mylifesucks.de/oss/c-osd/                      *
5
 *                                                                          *
5
 *                                                                          *
6
 *   This program is free software; you can redistribute it and/or modify   *
6
 *   This program is free software; you can redistribute it and/or modify   *
7
 *   it under the terms of the GNU General Public License as published by   *
7
 *   it under the terms of the GNU General Public License as published by   *
Line 78... Line 78...
78
            // motors are on, assume we were/are flying
78
            // motors are on, assume we were/are flying
79
            COSD_FLAGS_RUNTIME |= COSD_WASFLYING;
79
            COSD_FLAGS_RUNTIME |= COSD_WASFLYING;
80
        } else {
80
        } else {
81
            // stats
81
            // stats
82
            if ((COSD_FLAGS_RUNTIME & COSD_WASFLYING) && (COSD_FLAGS_MODES & COSD_FLAG_STATS)) {
82
            if ((COSD_FLAGS_RUNTIME & COSD_WASFLYING) && (COSD_FLAGS_MODES & COSD_FLAG_STATS)) {
83
                uint8_t line = 3;
-
 
84
                write_ascii_string_pgm(2, line, (const char *)(pgm_read_word(&(stats_item_pointers[0])))); // max Altitude
-
 
85
                write_ndigit_number_s(18, line, max_Altimeter / 20, 4, 0);
-
 
86
                write_char_xy(22, line, 204); // small meters m
-
 
87
                write_ascii_string_pgm(2, ++line, (const char *)(pgm_read_word(&(stats_item_pointers[1])))); // max Speed
-
 
88
                write_ndigit_number_u(19, line, (uint16_t)(((uint32_t)max_GroundSpeed * (uint32_t)9) / (uint32_t)250), 3, 0);
-
 
89
                write_char_xy(22, line, 203); // km/h
-
 
90
                write_ascii_string_pgm(2, ++line, (const char *)(pgm_read_word(&(stats_item_pointers[2])))); // max Distance
-
 
91
                write_ndigit_number_u(19, line, max_Distance / 10, 3, 0);
-
 
92
                write_char_xy(22, line, 204); // small meters m
-
 
93
                write_ascii_string_pgm(2, ++line, (const char *)(pgm_read_word(&(stats_item_pointers[3])))); // min voltage
-
 
94
                write_ndigit_number_u_10th(18, line, min_UBat, 3, 0);
-
 
95
                write_char_xy(22, line, 0x9E); // small V
-
 
96
                if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) {
-
 
97
                    write_ascii_string_pgm(2, ++line, (const char *)(pgm_read_word(&(stats_item_pointers[7])))); // ampere
-
 
98
                    write_ndigit_number_u_10th(18, line, max_ampere / 10, 3, 0);
-
 
99
                    write_char_xy(22, line, 0x9F); // small A
-
 
100
                }
-
 
101
                write_ascii_string_pgm(2, ++line, (const char *)(pgm_read_word(&(stats_item_pointers[4])))); // max time
-
 
102
                write_time(16, line, max_FlyingTime);
-
 
103
                write_char_xy(22, line, 210); // fly clock
-
 
104
                write_ascii_string_pgm(2, ++line, (const char *)(pgm_read_word(&(stats_item_pointers[5])))); // longitude
-
 
105
                write_gps_pos(15, line, naviData.CurrentPosition.Longitude);
-
 
106
                write_ascii_string_pgm(2, ++line, (const char *)(pgm_read_word(&(stats_item_pointers[6])))); // latitude
-
 
107
                write_gps_pos(15, line, naviData.CurrentPosition.Latitude);
-
 
108
            } else if (COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON) { // if no stats there is space horizon
-
 
109
                if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) {
-
 
110
                    draw_artificial_horizon(top_line + 2, bottom_line - 2, naviData.AngleNick, naviData.AngleRoll);
-
 
111
                } else {
83
                draw_stats();
112
                    draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll);
-
 
113
                }
-
 
114
            }
84
            }
115
        }
85
        }
116
        if (COSD_FLAGS_MODES & COSD_FLAG_BIGVARIO) {
86
        if (COSD_FLAGS_MODES & COSD_FLAG_BIGVARIO) {
117
            draw_big_variometer(27, 8, naviData.Variometer);
87
            draw_big_variometer(27, 8, naviData.Variometer);
118
        }
88
        }