Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 467 → Rev 466

/C-OSD/trunk/CHANGE.LOG
18,9 → 18,6
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
****************************************************************************/
 
20090517-2345
*modded the real alpha stuff i have been talking about below
20090516-2345
+some really testing stuff 'bout current measurement, more to come
 
/C-OSD/trunk/main.c
72,9 → 72,8
char stats_item_4[] PROGMEM = "max time :";
char stats_item_5[] PROGMEM = "longitude :";
char stats_item_6[] PROGMEM = "latitude :";
char stats_item_7[] PROGMEM = "max current :";
char* stats_item_pointers[] PROGMEM = {stats_item_0, stats_item_1, stats_item_2,
stats_item_3, stats_item_4, stats_item_5, stats_item_6, stats_item_7};
stats_item_3, stats_item_4, stats_item_5, stats_item_6};
 
// store more fixed strings in progmen
char ON[] PROGMEM = "ON ";
152,7 → 151,7
volatile unsigned char * iptr;
volatile unsigned char spi_cmd_buffer[5];
volatile uint8_t spi_ready = 1;
int16_t ampere = 0, max_ampere = 0;
int16_t ampere = 0;
 
/**
* SPI interrupt handler
554,12 → 553,8
if (spi_cmd_buffer[0] == 'd') {
ampere = spi_cmd_buffer[1] << 8;
ampere |= spi_cmd_buffer[2];
// if this is the first receival we should print the small A
if (!(COSD_FLAGS2 & COSD_FLAG_STROMREC)) {
COSD_FLAGS &= ~COSD_ICONS_WRITTEN;
// update this flag
COSD_FLAGS2 |= COSD_FLAG_STROMREC;
}
// update flags
COSD_FLAGS2 |= COSD_FLAG_STROMREC;
//write_ascii_char(8+4*30, 'v'); // valid
} else {
// update flags
/C-OSD/trunk/osd_ncmode_default.c
29,7 → 29,7
write_char_xy(27, top_line + 1, 0xCC); // small meters m home
write_char_xy(7, bottom_line, 0x9E); // small V
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
write_char_xy(7, bottom_line - 1, 0x9F); // small A
write_char_xy(7, bottom_line, 0x9F); // small A
}
write_char_xy(14, bottom_line, 0xD1); // on clock
write_char_xy(21, bottom_line, 0xD2); // fly clock
99,31 → 99,25
} else {
// stats
if ((COSD_FLAGS & COSD_WASFLYING) && (COSD_FLAGS & COSD_FLAG_STATS)) {
uint8_t line = 4;
write_ascii_string_pgm(2, line, stats_item_pointers[0]); // max Altitude
write_ndigit_number_s(18, line, max_Altimeter / 30, 1000, 0);
write_char_xy(22, line, 204); // small meters m
write_ascii_string_pgm(2, ++line, stats_item_pointers[1]); // max Speed
write_ndigit_number_u(19, line, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 100, 0);
write_char_xy(22, line, 203); // km/h
write_ascii_string_pgm(2, ++line, stats_item_pointers[2]); // max Distance
write_ndigit_number_u(19, line, max_Distance / 10, 100, 0);
write_char_xy(22, line, 204); // small meters m
write_ascii_string_pgm(2, ++line, stats_item_pointers[3]); // min voltage
write_ndigit_number_u_10th(18, line, min_UBat, 100, 0);
write_char_xy(22, line, 0x9E); // small v
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
write_ascii_string_pgm(2, ++line, stats_item_pointers[7]); // ampere
write_ndigit_number_u_10th(18, line, max_ampere / 10, 100, 0);
write_char_xy(22, line, 0x9F); // small v
}
write_ascii_string_pgm(2, ++line, stats_item_pointers[4]); // max time
write_time(16, line, max_FlyingTime);
write_char_xy(22, line, 210); // fly clock
write_ascii_string_pgm(2, ++line, stats_item_pointers[5]); // longitude
write_gps_pos(15, line, naviData.CurrentPosition.Longitude);
write_ascii_string_pgm(2, ++line, stats_item_pointers[6]); // latitude
write_gps_pos(15, line, naviData.CurrentPosition.Latitude);
write_ascii_string_pgm(2, 4, stats_item_pointers[0]); // max Altitude
write_ndigit_number_s(18, 4, max_Altimeter / 30, 1000, 0);
write_char_xy(22, 4, 204); // small meters m
write_ascii_string_pgm(2, 5, stats_item_pointers[1]); // max Speed
write_ndigit_number_u(19, 5, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 100, 0);
write_char_xy(22, 5, 203); // km/h
write_ascii_string_pgm(2, 6, stats_item_pointers[2]); // max Distance
write_ndigit_number_u(19, 6, max_Distance / 10, 100, 0);
write_char_xy(22, 6, 204); // small meters m
write_ascii_string_pgm(2, 7, stats_item_pointers[3]); // min voltage
write_ndigit_number_u_10th(18, 7, min_UBat, 100, 0);
write_char_xy(22, 7, 0x9E); // small v
write_ascii_string_pgm(2, 8, stats_item_pointers[4]); // max time
write_time(16, 8, max_FlyingTime);
write_char_xy(22, 8, 210); // fly clock
write_ascii_string_pgm(2, 9, stats_item_pointers[5]); // longitude
write_gps_pos(15, 9, naviData.CurrentPosition.Longitude);
write_ascii_string_pgm(2, 10, stats_item_pointers[6]); // latitude
write_gps_pos(15, 10, naviData.CurrentPosition.Latitude);
} else if (COSD_FLAGS & COSD_FLAG_ARTHORIZON) { // if no stats there is space horizon
draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll);
}
134,8 → 128,7
 
// pre-bottom line
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
//write_ndigit_number_s(3, bottom_line - 1, ampere, 1000, 0);
write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 100, 0);
write_ndigit_number_s(3, bottom_line - 1, ampere, 1000, 0);
}
 
// bottom line
182,7 → 175,6
}
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;
}
 
old_MKFlags = naviData.MKFlags;