Subversion Repositories Projects

Rev

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

Rev 1197 Rev 1281
Line 99... Line 99...
99
    if (voltage < min_voltage) percent = 0;
99
    if (voltage < min_voltage) percent = 0;
100
    write_char_xy(x, y, 0x9d - (percent * 13 / 100));
100
    write_char_xy(x, y, 0x9d - (percent * 13 / 100));
101
    //write_ndigit_number_u(x, y-1, percent * 13 / 100, 100, 0);
101
    //write_ndigit_number_u(x, y-1, percent * 13 / 100, 100, 0);
102
}
102
}
Line -... Line 103...
-
 
103
 
-
 
104
 
-
 
105
 
-
 
106
/* ##########################################################################
-
 
107
 * draw logo
-
 
108
 * ##########################################################################*/
-
 
109
 
-
 
110
/**
-
 
111
 * draw the logo at <x>/<y>
-
 
112
 */
-
 
113
void draw_logo(uint8_t x, uint8_t y) {
-
 
114
    uint8_t chr = 0x50;
-
 
115
 
-
 
116
    for (uint8_t yy = y; yy < y + 2; yy++) {
-
 
117
        for (uint8_t xx = x; xx < x + 8; xx++) {
-
 
118
            write_char_xy(xx, yy, chr++);
-
 
119
        }
-
 
120
    }
-
 
121
}
103
 
122
 
104
/* ##########################################################################
123
/* ##########################################################################
105
 * variometer
124
 * variometer
Line 106... Line 125...
106
 * ##########################################################################*/
125
 * ##########################################################################*/
Line 110... Line 129...
110
 */
129
 */
111
void draw_variometer(uint8_t x, uint8_t y, int16_t variometer) {
130
void draw_variometer(uint8_t x, uint8_t y, int16_t variometer) {
112
    uint8_t chr = 0xbb;
131
    uint8_t chr = 0xbb;
113
    if (variometer > 0) { // gain height
132
    if (variometer > 0) { // gain height
114
        chr = 0x70 + (variometer / 5);
133
        chr = 0x70 + (variometer / 5);
115
        if (chr > 0x73) chr = 0x73;      
134
        if (chr > 0x73) chr = 0x73;
116
    } else { // sink
135
    } else { // sink
117
        chr = 0x77 - (variometer / -5);
136
        chr = 0x77 - (variometer / -5);
118
        if (chr < 0x74) chr = 0x74;
137
        if (chr < 0x74) chr = 0x74;
119
    }
138
    }
120
    write_char_xy(x, y, chr);
139
    write_char_xy(x, y, chr);
Line 310... Line 329...
310
 */
329
 */
311
void draw_stats() {
330
void draw_stats() {
312
#if FCONLY
331
#if FCONLY
313
#else
332
#else
314
    uint8_t line = 3;
333
    uint8_t line = 3;
315
    write_ascii_string_pgm(1, line, PSTR("max Altitude:")); // max Altitude
334
    write_ascii_string_pgm(1, line,   PSTR("max Alt :")); // max Altitude
316
    write_ascii_string_pgm(1, ++line, PSTR("max Speed :")); // max Speed
335
    write_ascii_string_pgm(1, ++line, PSTR("max Spd :")); // max Speed
317
    write_ascii_string_pgm(1, ++line, PSTR("max Distance:")); // max Distance
336
    write_ascii_string_pgm(1, ++line, PSTR("max Dist:")); // max Distance
-
 
337
 
-
 
338
     draw_logo(19, 4);
Line 318... Line 339...
318
 
339
 
319
    if (COSD_FLAGS_CONFIG & COSD_FLAG_FEET) {
340
    if (COSD_FLAGS_CONFIG & COSD_FLAG_FEET) {
320
        write_ndigit_number_s(16, line - 2, max_Altimeter * 32 / 10, 4, 0);
341
        write_ndigit_number_s(13, line - 2, max_Altimeter * 32 / 10, 4, 0);
321
        write_char_xy(20, line - 2, 0x7E); // small feet ft
342
        write_char_xy(17, line - 2, 0x7E); // small feet ft
322
        write_ndigit_number_u(17, line - 1, (uint16_t)(((uint32_t)max_GroundSpeed * (uint32_t)279) / (uint32_t)12500), 3, 0);
343
        write_ndigit_number_u(14, line - 1, (uint16_t)(((uint32_t)max_GroundSpeed * (uint32_t)279) / (uint32_t)12500), 3, 0);
323
        write_char_xy(20, line - 1, 0x7D); // mp/h
344
        write_char_xy(17, line - 1, 0x7D); // mp/h
324
        write_ndigit_number_u(16, line - 0, max_Distance / 10 * 32 / 10, 4, 0);
345
        write_ndigit_number_u(13, line - 0, max_Distance / 10 * 32 / 10, 4, 0);
325
        write_char_xy(20, line - 0, 0x7E); // small feet ft
346
        write_char_xy(17, line - 0, 0x7E); // small feet ft
326
    } else {
347
    } else {
327
        write_ndigit_number_s(16, line - 2, max_Altimeter, 4, 0);
348
        write_ndigit_number_s(13, line - 2, max_Altimeter, 4, 0);
328
        write_char_xy(20, line - 2, 204); // small meters m
349
        write_char_xy(17, line - 2, 204); // small meters m
329
        write_ndigit_number_u(17, line - 1, (uint16_t)(((uint32_t)max_GroundSpeed * (uint32_t)9) / (uint32_t)250), 3, 0);
350
        write_ndigit_number_u(14, line - 1, (uint16_t)(((uint32_t)max_GroundSpeed * (uint32_t)9) / (uint32_t)250), 3, 0);
330
        write_char_xy(20, line - 1, 203); // km/h
351
        write_char_xy(17, line - 1, 203); // km/h
331
        write_ndigit_number_u(16, line - 0, max_Distance / 10, 4, 0);
352
        write_ndigit_number_u(13, line - 0, max_Distance / 10, 4, 0);
332
        write_char_xy(20, line - 0, 204); // small meters m
353
        write_char_xy(17, line - 0, 204); // small meters m
Line 333... Line 354...
333
    }
354
    }
334
 
355
 
335
    write_ascii_string_pgm(1, ++line, PSTR("min Voltage :")); // min voltage
356
    write_ascii_string_pgm(1, ++line,     PSTR("min Volt:")); // min voltage
336
    write_ndigit_number_u_10th(16, line, min_UBat, 3, 0);
357
    write_ndigit_number_u_10th(13, line, min_UBat, 3, 0);
337
    write_char_xy(20, line, 0x9E); // small V
358
    write_char_xy(17, line, 0x9E); // small V
338
    if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) || (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) {
359
    if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) || (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) {
339
        write_ascii_string_pgm(1, ++line, PSTR("max current :")); // ampere
360
        write_ascii_string_pgm(1, ++line, PSTR("max curr:")); // ampere
Line 340... Line 361...
340
        write_ndigit_number_u_10th(16, line, max_ampere / 10, 3, 0);
361
        write_ndigit_number_u_10th(16, line, max_ampere / 10, 3, 0);
341
        write_char_xy(20, line, 0x9F); // small A
362
        write_char_xy(17, line, 0x9F); // small A
342
 
363
 
343
        // wasted mampere in this flight (will count up after landing)
364
        // wasted mampere in this flight (will count up after landing)
Line 344... Line 365...
344
        if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) {
365
        if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) {
345
            write_ndigit_number_u(21, line, (ampere_wasted / 10) - wasted_ampere_offset, 5, 0);
366
            write_ndigit_number_u(18, line, (ampere_wasted / 10) - wasted_ampere_offset, 5, 0);
Line 346... Line 367...
346
        } else if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) {
367
        } else if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) {
347
 
368
 
348
            write_ndigit_number_u(21, line, naviData.UsedCapacity - wasted_ampere_offset, 5, 0);
369
            write_ndigit_number_u(18, line, naviData.UsedCapacity - wasted_ampere_offset, 5, 0);
349
        }
370
        }
350
 
371
 
351
        write_char_xy(26, line, 0xB5); // mah
372
        write_char_xy(23, line, 0xB5); // mah
352
    }
373
    }
353
    write_ascii_string_pgm(1, ++line, PSTR("max Time:")); // max time
374
    write_ascii_string_pgm(1, ++line, PSTR("max Time:")); // max time
354
    write_time(14, line, max_FlyingTime);
375
    write_time(11, line, max_FlyingTime);
355
    write_char_xy(20, line, 210); // fly clock
376
    write_char_xy(17, line, 210); // fly clock
356
    write_ascii_string_pgm(1, ++line, PSTR("longitude :")); // longitude
377
    write_ascii_string_pgm(1, ++line, PSTR("long    :")); // longitude
Line 357... Line 378...
357
    write_gps_pos(14, line, naviData.CurrentPosition.Longitude);
378
    write_gps_pos(11, line, naviData.CurrentPosition.Longitude);