Subversion Repositories Projects

Compare Revisions

Regard whitespace Rev 727 → Rev 728

/C-OSD/trunk/CHANGE.LOG
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/ *
* *
18,6 → 18,10
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
****************************************************************************/
 
20100212-2310
*adapted MK-datastructs to NC 0.18c
*added choice for current display measured by FC
 
20091109-1100
+fc-only mode by Josef "jopl" Plasil (MK3Mag on FC and no NC)
*usart1 routine to filter out unwanted datasets (also big thanks to jopl)
/C-OSD/trunk/README.TXT
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/ *
* *
/C-OSD/trunk/buttons.c
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/ *
* *
/C-OSD/trunk/buttons.h
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/ *
* *
/C-OSD/trunk/characters.c
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/ *
* *
/C-OSD/trunk/characters.h
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/ *
* *
/C-OSD/trunk/config.c
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/ *
* *
61,7 → 61,8
const char menu_item2[] PROGMEM = "Art.Horizon in HUD";
const char menu_item3[] PROGMEM = "Big Vario bar";
const char menu_item4[] PROGMEM = "Statistics";
const char menu_item5[] PROGMEM = "Warnings"; // TODO: do it!
//const char menu_item5[] PROGMEM = "Warnings"; // TODO: do it!
const char menu_item5[] PROGMEM = "Current by FC";
const char menu_item6[] PROGMEM = "Voltage by C-Strom";
const char menu_item7[] PROGMEM = "Reset uptime";
const char menu_item8[] PROGMEM = "Display Mode";
242,10 → 243,15
} else {
write_ascii_string_pgm(23, 6, OFF);
}
if (COSD_FLAGS_MODES & COSD_FLAG_WARNINGS) {
/*if (COSD_FLAGS_MODES & COSD_FLAG_WARNINGS) {
write_ascii_string_pgm(23, 7, ON);
} else {
write_ascii_string_pgm(23, 7, OFF);
}*/
if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) {
write_ascii_string_pgm(23, 7, ON);
} else {
write_ascii_string_pgm(23, 7, OFF);
}
if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) {
write_ascii_string_pgm(23, 8, ON);
343,9 → 349,13
COSD_FLAGS_MODES ^= COSD_FLAG_STATS;
config_menu_drawings(chosen);
break;
case 5: // warnings
/*case 5: // warnings
COSD_FLAGS_MODES ^= COSD_FLAG_WARNINGS;
config_menu_drawings(chosen);
break;*/
case 5: // current by fc
COSD_FLAGS_MODES ^= COSD_FLAG_FCCURRENT;
config_menu_drawings(chosen);
break;
case 6: // 2nd voltage by c-strom
COSD_FLAGS_MODES ^= COSD_FLAG_STROMVOLT;
/C-OSD/trunk/config.h
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/ *
* *
/C-OSD/trunk/main.c
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/ *
* *
/C-OSD/trunk/main.h
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/ *
* *
67,7 → 67,9
#define COSD_FLAG_STATS 8
#define COSD_FLAG_WARNINGS 16
#define COSD_FLAG_STROMVOLT 32
#define COSD_FLAG_FCCURRENT 64
 
 
#define COSD_FLAG_NTSC 1
#define COSD_FLAG_GPSHEIGHT 2
#define COSD_FLAG_FCMODE 4
/C-OSD/trunk/max7456_software_spi.c
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/ *
* *
/C-OSD/trunk/max7456_software_spi.h
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/ *
* *
/C-OSD/trunk/mk-data-structs.h
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/ *
* *
52,7 → 52,7
/*
* NaviCtrl OSD Structs
* portions taken and adapted from
* http://svn.mikrokopter.de/mikrowebsvn/filedetails.php?repname=NaviCtrl&path=%2Ftags%2FV0.17e%2Fuart1.h
* http://svn.mikrokopter.de/mikrowebsvn/filedetails.php?repname=NaviCtrl&path=%2Ftags%2FV0.18c%2Fuart1.h
*/
typedef struct {
s32 Longitude; // in 1E-7 deg
85,12 → 85,12
u16 FlyingTime; // in seconds
u8 UBat; // Battery Voltage in 0.1 Volts
u16 GroundSpeed; // speed over ground in cm/s (2D)
s16 Heading; // current flight direction in ° as angle to north
s16 CompassHeading; // current compass value in °
s8 AngleNick; // current Nick angle in 1°
s8 AngleRoll; // current Rick angle in 1°
s16 Heading; // current flight direction in � as angle to north
s16 CompassHeading; // current compass value in �
s8 AngleNick; // current Nick angle in 1�
s8 AngleRoll; // current Rick angle in 1�
u8 RC_Quality; // RC_Quality
u8 MKFlags; // Flags from FC
u8 FCFlags; // Flags from FC
u8 NCFlags; // Flags from NC
u8 Errorcode; // 0 --> okay
u8 OperatingRadius; // current operation radius around the Home Position in m
99,8 → 99,11
u8 RC_RSSI; // Receiver signal strength (since version 2 added)
s16 SetpointAltitude; // setpoint for altitude
u8 Gas; // for future use
u16 Current; // actual current in 0.1A steps
u16 UsedCapacity; // used capacity in mAh
} __attribute__((packed)) NaviData_t;
 
 
/*
* MikroKopter Flags
* taken from
/C-OSD/trunk/osd_fcmode_default.c
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/ *
* *
/C-OSD/trunk/osd_fcmode_default.h
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/ *
* *
/C-OSD/trunk/osd_fcmode_jopl.c
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/ *
* *
/C-OSD/trunk/osd_fcmode_jopl.h
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/ *
* *
/C-OSD/trunk/osd_helpers.c
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/ *
* *
/C-OSD/trunk/osd_helpers.h
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/ *
* *
/C-OSD/trunk/osd_ncmode_default.c
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,7 → 141,7
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
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,7 → 166,7
}
 
// 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);
173,8 → 173,13
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 ((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;
/C-OSD/trunk/osd_ncmode_default.h
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/ *
* *
/C-OSD/trunk/osd_ncmode_minimal.c
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/ *
* *
61,7 → 61,7
 
 
// 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();
// update flags to paint display again if needed
148,7 → 148,7
}
 
// remember statistics (only when engines running)
if (naviData.MKFlags & FLAG_MOTOR_RUN) {
if (naviData.FCFlags & FLAG_MOTOR_RUN) {
if (naviData.Altimeter > max_Altimeter) max_Altimeter = naviData.Altimeter;
if (naviData.GroundSpeed > max_GroundSpeed) max_GroundSpeed = naviData.GroundSpeed;
if (naviData.HomePositionDeviation.Distance > max_Distance) {
162,7 → 162,7
// 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;
/C-OSD/trunk/osd_ncmode_minimal.h
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/ *
* *
/C-OSD/trunk/ppm.c
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/ *
* *
/C-OSD/trunk/ppm.h
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/ *
* *
/C-OSD/trunk/spi.c
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/ *
* *
/C-OSD/trunk/spi.h
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/ *
* *
/C-OSD/trunk/usart1.c
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/ *
* *
/C-OSD/trunk/usart1.h
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/ *
* *