1,5 → 1,5 |
/**************************************************************************** |
* Copyright (C) 2009 by Claas Anders "CaScAdE" Rathje * |
* Copyright (C) 2009-2010 by Claas Anders "CaScAdE" Rathje * |
* admiralcascade@gmail.com * |
* Project-URL: http://www.mylifesucks.de/oss/c-osd/ * |
* * |
37,7 → 37,7 |
write_char_xy(22, top_line + 1, 0xB2); // right circle |
write_char_xy(27, top_line + 1, 0xCC); // small meters m home |
write_char_xy(7, bottom_line, 0x9E); // small V |
if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) || (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
write_char_xy(7, bottom_line - 1, 0x9F); // small A |
write_char_xy(14, bottom_line - 1, 0xB5); // mah |
if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) { |
108,7 → 108,7 |
write_ndigit_number_u(24, top_line + 1, naviData.HomePositionDeviation.Distance / 10, 3, 0); |
|
// center |
if (naviData.MKFlags & FLAG_MOTOR_RUN) { // should be engines running |
if (naviData.FCFlags & FLAG_MOTOR_RUN) { // should be engines running |
if (!(old_MKFlags & FLAG_MOTOR_RUN)) { // motors just started, clear middle |
clear(); |
// remember current heigth for gps offset |
141,11 → 141,11 |
write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[3])))); // min voltage |
write_ndigit_number_u_10th(18, line, min_UBat, 3, 0); |
write_char_xy(22, line, 0x9E); // small V |
if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) || (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[7])))); // ampere |
write_ndigit_number_u_10th(18, line, max_ampere / 10, 3, 0); |
write_char_xy(22, line, 0x9F); // small A |
} |
} |
write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[4])))); // max time |
write_time(16, line, max_FlyingTime); |
write_char_xy(22, line, 210); // fly clock |
154,7 → 154,7 |
write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[6])))); // latitude |
write_gps_pos(15, line, naviData.CurrentPosition.Latitude); |
} else if (COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON) { // if no stats there is space horizon |
if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) || (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
draw_artificial_horizon(top_line + 2, bottom_line - 2, naviData.AngleNick, naviData.AngleRoll); |
} else { |
draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll); |
166,15 → 166,20 |
} |
|
// pre-bottom line |
if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
//write_ndigit_number_s(3, bottom_line - 1, ampere, 4, 0); |
write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 3, 0); |
write_ndigit_number_s(10, bottom_line - 1, ampere_wasted / 10, 4, 0); |
if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) { |
write_ndigit_number_u_10th(17, bottom_line - 1, s_volt, 3, 0); |
} |
} |
} else if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) { |
write_ndigit_number_u_10th(3, bottom_line - 1, naviData.Current, 3, 0); |
write_ndigit_number_u(10, bottom_line - 1, naviData.UsedCapacity, 4, 0); |
} |
|
//DEBUGwrite_ndigit_number_u(1, 5, COSD_FLAGS_MODES, 3, 0); |
|
// bottom line |
draw_battery(2, bottom_line, min_voltage, naviData.UBat, max_voltage); |
write_ndigit_number_u_10th(3, bottom_line, naviData.UBat, 3, 0); |
210,7 → 215,7 |
//write_number_s(16, 5, setsReceived++); |
|
// remember statistics (only when engines running) |
if (naviData.MKFlags & FLAG_MOTOR_RUN) { |
if (naviData.FCFlags & FLAG_MOTOR_RUN) { |
if (COSD_FLAGS_CONFIG & COSD_FLAG_GPSHEIGHT) { |
if (naviData.CurrentPosition.Altitude / 1000 - altimeter_offset > max_Altimeter) max_Altimeter = naviData.CurrentPosition.Altitude / 1000; |
} else { |
222,13 → 227,17 |
} |
if (naviData.UBat < min_UBat) min_UBat = naviData.UBat; |
if (naviData.FlyingTime > max_FlyingTime) max_FlyingTime = naviData.FlyingTime; |
if (ampere > max_ampere) max_ampere = ampere; |
if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
if (ampere > max_ampere) max_ampere = ampere; |
} else if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) { |
if (naviData.Current * 10 > max_ampere) max_ampere = naviData.Current * 10; |
} |
} |
|
// remember last values |
last_RC_Quality = naviData.RC_Quality; |
last_UBat = naviData.UBat; |
old_MKFlags = naviData.MKFlags; |
old_MKFlags = naviData.FCFlags; |
seconds_since_last_data = 0; |
|
return 0; |