Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 1517 → Rev 1518

/Transportables_Koptertool/branch/GPL_PKT_V3_5_8b_FC086/osd.c
311,13 → 311,13
 
for(ij=0;ij<6;ij++)
{
uint32_t lon = last5pos[ij].Longitude;
uint32_t lon = last5pos[ij].Latitude;
write_ndigit_number_u (1, ij+1, (uint16_t)(lon/10000000), 2, 0);
lcd_printp_at (3, ij+1, PSTR("."), 0);
write_ndigit_number_u (4, ij+1, (uint16_t)((lon/1000) % 10000), 4, 1);
write_ndigit_number_u (8, ij+1, (uint16_t)((lon/10) % 100), 2, 1);
 
uint32_t lat = last5pos[ij].Latitude;
uint32_t lat = last5pos[ij].Longitude;
write_ndigit_number_u (12, ij+1, (uint16_t)(lat/10000000), 2, 0);
lcd_printp_at (14, ij+1, PSTR("."), 0);
write_ndigit_number_u (15, ij+1, (uint16_t)((lat/1000) % 10000), 4, 1);
330,8 → 330,118
get_key_press(KEY_ALL);
lcd_cls();
}
void Show_LastPosition(void)
{
lcd_puts_at(0, 5, strGet(START_LASTPOS1), 0);
uint32_t lon = last5pos[0].Latitude;
write_ndigit_number_u (1, 6, (uint16_t)(lon/10000000), 2, 0);
lcd_printp_at (3, 6, PSTR("."), 0);
write_ndigit_number_u (4, 6, (uint16_t)((lon/1000) % 10000), 4, 1);
write_ndigit_number_u (8, 6, (uint16_t)((lon/10) % 100), 2, 1);
 
uint32_t lat = last5pos[0].Longitude;
write_ndigit_number_u (12, 6, (uint16_t)(lat/10000000), 2, 0);
lcd_printp_at (14, 6, PSTR("."), 0);
write_ndigit_number_u (15, 6, (uint16_t)((lat/1000) % 10000), 4, 1);
write_ndigit_number_u (19, 6, (uint16_t)((lat/10) % 100), 2, 1);
 
}
 
void OSD_Timeout(uint8_t flag)
{
 
// uint8_t flag;
uint8_t tmp_dat;
// flag = 0;
timer = TIMEOUT;
// disable OSD Data from NC
// RS232_request_mk_data (1, 'o', 0);
// tmp_dat = 0;
// SendOutData ('o', ADDRESS_NC, 1, &tmp_dat, 1);
 
mode = 0;
rxd_buffer_locked = FALSE;
 
 
// Bei Verbindungsverlusst werden hier die letzten bekannten Koordinaten ausgegeben!!!
// if (!timer)
// { // timeout occured
if (flag)
{
// Falls Spannungswarnung an war Beeper aus//
BeepTime = 0;
BeepMuster = 0xFFFF;
 
lcd_cls ();
WriteLastPosition(last5pos[0].Longitude,last5pos[0].Latitude); // im EEprom speichern
lcd_puts_at(0, 0, strGet(OSD_ERROR), 2);
 
// lcd_printp_at (0, 0, PSTR(" ERROR: Datenverlust "), 2);
 
// lcd_printp_at (0, 2, PSTR("Letzte bekannte"), 0);
// lcd_printp_at (0, 3, PSTR("Position gespeichert."), 0);
lcd_puts_at(0, 2, strGet(OSD_POS1), 0);
lcd_puts_at(0, 3, strGet(OSD_POS2), 0);
// lcd_printp_at (19, 7, PSTR("OK"), 0);
lcd_puts_at(19, 7, strGet(OK), 0);
// lcd_printp_at (0, 5, PSTR(" Breitengr Längengr "), 0);
 
lcd_puts_at(0, 5, strGet(START_LASTPOS1), 0);
 
lcd_puts_at(12, 7, strGet(ENDE), 0);
 
BeepTime = 250;
BeepMuster = 0x0080;
error = 1;
 
uint32_t lon = last5pos[0].Latitude;
write_ndigit_number_u (1, 6, (uint16_t)(lon/10000000), 2, 0);
lcd_printp_at (3, 6, PSTR("."), 0);
write_ndigit_number_u (4, 6, (uint16_t)((lon/1000) % 10000), 4, 1);
write_ndigit_number_u (8, 6, (uint16_t)((lon/10) % 100), 2, 1);
 
uint32_t lat = last5pos[0].Longitude;
write_ndigit_number_u (12, 6, (uint16_t)(lat/10000000), 2, 0);
lcd_printp_at (14, 6, PSTR("."), 0);
write_ndigit_number_u (15, 6, (uint16_t)((lat/1000) % 10000), 4, 1);
write_ndigit_number_u (19, 6, (uint16_t)((lat/10) % 100), 2, 1);
 
// while (!get_key_press (1 << KEY_ENTER));
_delay_ms(1000);
timer = TIMEOUT;
lcd_cls();
// return;
 
 
}
else
{
lcd_puts_at(0, 0, strGet(OSD_ERROR), 2);
Show_LastPosition();
BeepTime = 250;
BeepMuster = 0x0080;
}
// }
SwitchToNC();
 
mode = 'O';
 
// disable debug...
// RS232_request_mk_data (0, 'd', 0);
tmp_dat = 0;
SendOutData ('d', ADDRESS_ANY, 1, &tmp_dat, 1);
 
// request OSD Data from NC every 100ms
// RS232_request_mk_data (1, 'o', 100);
tmp_dat = 10;
SendOutData ('o', ADDRESS_NC, 1, &tmp_dat, 1);
 
 
}
 
 
 
 
//--------------------------------------------------------------
void osd (uint8_t ShowMode)
{
353,11 → 463,11
uint16_t old_hh = 0;
uint8_t old_AngleNick = 0;
uint8_t old_AngleRoll = 0;
 
lcd_cls();
OSD_Mode = ShowMode;
 
if(error == 0)
lcd_cls();
// if(error == 0)
// lcd_cls();
 
if (hardware == FC)
{
625,71 → 735,77
abo_timer = ABO_TIMEOUT;
}
}
if (!timer)
{
OSD_Timeout(flag);
flag = 0;
}
}
while (!get_key_press (1 << KEY_ESC) && timer);
 
get_key_press(KEY_ALL);
 
 
// disable OSD Data from NC
// RS232_request_mk_data (1, 'o', 0);
tmp_dat = 0;
SendOutData ('o', ADDRESS_NC, 1, &tmp_dat, 1);
 
mode = 0;
rxd_buffer_locked = FALSE;
 
 
// Bei Verbindungsverlusst werden hier die letzten bekannten Koordinaten ausgegeben!!!
if (!timer)
{ // timeout occured
if (flag)
{
// Falls Spannungswarnung an war Beeper aus//
BeepTime = 0;
BeepMuster = 0xFFFF;
 
lcd_cls ();
WriteLastPosition(last5pos[0].Longitude,last5pos[0].Latitude); // im EEprom speichern
lcd_puts_at(0, 0, strGet(OSD_ERROR), 2);
 
// lcd_printp_at (0, 0, PSTR(" ERROR: Datenverlust "), 2);
 
// lcd_printp_at (0, 2, PSTR("Letzte bekannte"), 0);
// lcd_printp_at (0, 3, PSTR("Position gespeichert."), 0);
lcd_puts_at(0, 2, strGet(OSD_POS1), 0);
lcd_puts_at(0, 3, strGet(OSD_POS2), 0);
// lcd_printp_at (19, 7, PSTR("OK"), 0);
lcd_puts_at(19, 7, strGet(OK), 0);
// lcd_printp_at (0, 5, PSTR(" Breitengr Längengr "), 0);
 
lcd_puts_at(0, 5, strGet(START_LASTPOS1), 0);
 
lcd_puts_at(12, 7, strGet(ENDE), 0);
 
BeepTime = 1500;
BeepMuster = 0x0040;
error = 1;
 
uint32_t lon = last5pos[0].Longitude;
write_ndigit_number_u (1, 6, (uint16_t)(lon/10000000), 2, 0);
lcd_printp_at (3, 6, PSTR("."), 0);
write_ndigit_number_u (4, 6, (uint16_t)((lon/1000) % 10000), 4, 1);
write_ndigit_number_u (8, 6, (uint16_t)((lon/10) % 100), 2, 1);
 
uint32_t lat = last5pos[0].Latitude;
write_ndigit_number_u (12, 6, (uint16_t)(lat/10000000), 2, 0);
lcd_printp_at (14, 6, PSTR("."), 0);
write_ndigit_number_u (15, 6, (uint16_t)((lat/1000) % 10000), 4, 1);
write_ndigit_number_u (19, 6, (uint16_t)((lat/10) % 100), 2, 1);
 
while (!get_key_press (1 << KEY_ENTER));
 
timer = TIMEOUT;
lcd_cls();
return;
 
}
}
while (!get_key_press (1 << KEY_ESC));
// while (!get_key_press (1 << KEY_ESC) && timer);
// get_key_press(KEY_ALL);
//
//
// // disable OSD Data from NC
// // RS232_request_mk_data (1, 'o', 0);
// tmp_dat = 0;
// SendOutData ('o', ADDRESS_NC, 1, &tmp_dat, 1);
//
// mode = 0;
// rxd_buffer_locked = FALSE;
//
//
// // Bei Verbindungsverlusst werden hier die letzten bekannten Koordinaten ausgegeben!!!
// if (!timer)
// { // timeout occured
// if (flag)
// {
// // Falls Spannungswarnung an war Beeper aus//
// BeepTime = 0;
// BeepMuster = 0xFFFF;
//
// lcd_cls ();
// WriteLastPosition(last5pos[0].Longitude,last5pos[0].Latitude); // im EEprom speichern
// lcd_puts_at(0, 0, strGet(OSD_ERROR), 2);
//
//// lcd_printp_at (0, 0, PSTR(" ERROR: Datenverlust "), 2);
//
//// lcd_printp_at (0, 2, PSTR("Letzte bekannte"), 0);
//// lcd_printp_at (0, 3, PSTR("Position gespeichert."), 0);
// lcd_puts_at(0, 2, strGet(OSD_POS1), 0);
// lcd_puts_at(0, 3, strGet(OSD_POS2), 0);
//// lcd_printp_at (19, 7, PSTR("OK"), 0);
// lcd_puts_at(19, 7, strGet(OK), 0);
//// lcd_printp_at (0, 5, PSTR(" Breitengr Längengr "), 0);
//
// lcd_puts_at(0, 5, strGet(START_LASTPOS1), 0);
//
// lcd_puts_at(12, 7, strGet(ENDE), 0);
//
// BeepTime = 1500;
// BeepMuster = 0x0040;
// error = 1;
//
// uint32_t lon = last5pos[0].Longitude;
// write_ndigit_number_u (1, 6, (uint16_t)(lon/10000000), 2, 0);
// lcd_printp_at (3, 6, PSTR("."), 0);
// write_ndigit_number_u (4, 6, (uint16_t)((lon/1000) % 10000), 4, 1);
// write_ndigit_number_u (8, 6, (uint16_t)((lon/10) % 100), 2, 1);
//
// uint32_t lat = last5pos[0].Latitude;
// write_ndigit_number_u (12, 6, (uint16_t)(lat/10000000), 2, 0);
// lcd_printp_at (14, 6, PSTR("."), 0);
// write_ndigit_number_u (15, 6, (uint16_t)((lat/1000) % 10000), 4, 1);
// write_ndigit_number_u (19, 6, (uint16_t)((lat/10) % 100), 2, 1);
//
// while (!get_key_press (1 << KEY_ENTER));
//
// timer = TIMEOUT;
// lcd_cls();
// return;
//
// }
// }
}