Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 410 → Rev 412

/C-OSD/trunk/CHANGE.LOG
18,6 → 18,10
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
****************************************************************************/
 
20090427-2315
+write_gps_pos(...) (needs to be tested)
+gps position is shown in stats screen for testing purpose
 
20090427-2131
*stats are only collected while engines running (shaddi)
 
124,4 → 128,4
* modified incoming data speed to 100ms (was 200ms)
 
20090326-2031
+ first binary release
+ first binary release
/C-OSD/trunk/main.c
70,8 → 70,10
char stats_item_2[] PROGMEM = "max Distance:";
char stats_item_3[] PROGMEM = "min voltage :";
char stats_item_4[] PROGMEM = "max time :";
char stats_item_5[] PROGMEM = "longitude :";
char stats_item_6[] PROGMEM = "latitude :";
char* stats_item_pointers[] PROGMEM = {stats_item_0, stats_item_1, stats_item_2,
stats_item_3, stats_item_4};
stats_item_3, stats_item_4, stats_item_5, stats_item_6};
 
// store more fixed strings in progmen
char ON[] PROGMEM = "ON ";
512,21 → 514,25
} else {
// stats
if ((COSD_FLAGS & COSD_WASFLYING) && (COSD_FLAGS & COSD_FLAG_STATS)) {
write_ascii_string_pgm(2, 5, stats_item_pointers[0]); // max Altitude
write_ndigit_number_s(18, 5, max_Altimeter / 30, 1000, 0);
write_char_xy(22, 5, 204); // small meters m
write_ascii_string_pgm(2, 6, stats_item_pointers[1]); // max Speed
write_ndigit_number_u(19, 6, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t)9) / (uint32_t)250), 100, 0);
write_char_xy(22, 6, 203); // km/h
write_ascii_string_pgm(2, 7, stats_item_pointers[2]); // max Distance
write_ndigit_number_u(19, 7, max_Distance / 10, 100, 0);
write_char_xy(22, 7, 204); // small meters m
write_ascii_string_pgm(2, 8, stats_item_pointers[3]); // min voltage
write_ndigit_number_u_10th(18, 8, min_UBat, 100, 0);
write_char_xy(22, 8, 0x9E); // small v
write_ascii_string_pgm(2, 9, stats_item_pointers[4]); // max time
write_time(16, 9, max_FlyingTime);
write_char_xy(22, 9, 210); // fly clock
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);
}
570,15 → 576,15
//write_number_s(16, 5, setsReceived++);
 
// remember statistics (only when engines running)
if (naviData.MKFlags & 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) {
max_Distance = naviData.HomePositionDeviation.Distance;
}
if (naviData.UBat < min_UBat) min_UBat = naviData.UBat;
if (naviData.FlyingTime > max_FlyingTime) max_FlyingTime = naviData.FlyingTime;
}
if (naviData.MKFlags & 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) {
max_Distance = naviData.HomePositionDeviation.Distance;
}
if (naviData.UBat < min_UBat) min_UBat = naviData.UBat;
if (naviData.FlyingTime > max_FlyingTime) max_FlyingTime = naviData.FlyingTime;
}
 
old_MKFlags = naviData.MKFlags;
seconds_since_last_data = 0;
/C-OSD/trunk/max7456_software_spi.c
355,3 → 355,22
// according to maxim writing to nvram takes about 12ms, lets wait longer
_delay_ms(120);
}
 
/**
* wirte a <position> at <x>/<y> assuming it is a gps position for long-/latitude
*/
void write_gps_pos(uint8_t x, uint8_t y, int32_t position) {
if (((uint32_t) position > 2147483647)) {
position = position - 4294967295;
write_char_xy(x++, y, 0x49); // minus
} else {
write_char_xy(x++, y, 0); // clear ('+' would be nice, maybe later)
}
write_ndigit_number_u(x, y, (uint16_t) (position / (int32_t) 10000000), 100, 1);
write_char_xy(x + 3, y, 65); // decimal point
position = position - ((position / (int32_t) 10000000) * (int32_t) 10000000);
write_ndigit_number_u(x + 4, y, (uint16_t) (position / (int32_t) 1000), 1000, 1);
position = position - ((uint16_t) (position / (int32_t) 1000) * (int32_t) 1000);
write_ndigit_number_u(x + 8, y, (uint16_t) position, 100, 1);
write_char_xy(x + 11, y, 0xD0); // degree symbol
}
/C-OSD/trunk/max7456_software_spi.h
138,3 → 138,8
* with <data>.
*/
void learn_char(uint8_t, unsigned char*);
 
/**
* wirte a <position> at <x>/<y> assuming it is a gps position for long-/latitude
*/
void write_gps_pos(uint8_t, uint8_t, int32_t);