Subversion Repositories Projects

Rev

Rev 1517 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1517 Rev 1518
Line 309... Line 309...
309
        lcd_puts_at(12, 7, strGet(ENDE), 0);
309
        lcd_puts_at(12, 7, strGet(ENDE), 0);
310
        uint8_t ij =0;
310
        uint8_t ij =0;
Line 311... Line 311...
311
 
311
 
312
        for(ij=0;ij<6;ij++)
312
        for(ij=0;ij<6;ij++)
313
        {
313
        {
314
                uint32_t lon = last5pos[ij].Longitude;
314
                uint32_t lon = last5pos[ij].Latitude;
315
                write_ndigit_number_u (1, ij+1, (uint16_t)(lon/10000000), 2, 0);
315
                write_ndigit_number_u (1, ij+1, (uint16_t)(lon/10000000), 2, 0);
316
                lcd_printp_at (3, ij+1, PSTR("."), 0);
316
                lcd_printp_at (3, ij+1, PSTR("."), 0);
317
                write_ndigit_number_u (4, ij+1, (uint16_t)((lon/1000) % 10000), 4, 1);
317
                write_ndigit_number_u (4, ij+1, (uint16_t)((lon/1000) % 10000), 4, 1);
Line 318... Line 318...
318
                write_ndigit_number_u (8, ij+1, (uint16_t)((lon/10) % 100), 2, 1);
318
                write_ndigit_number_u (8, ij+1, (uint16_t)((lon/10) % 100), 2, 1);
319
 
319
 
320
                uint32_t lat = last5pos[ij].Latitude;
320
                uint32_t lat = last5pos[ij].Longitude;
321
                write_ndigit_number_u (12, ij+1, (uint16_t)(lat/10000000), 2, 0);
321
                write_ndigit_number_u (12, ij+1, (uint16_t)(lat/10000000), 2, 0);
322
                lcd_printp_at (14, ij+1, PSTR("."), 0);
322
                lcd_printp_at (14, ij+1, PSTR("."), 0);
323
                write_ndigit_number_u (15, ij+1, (uint16_t)((lat/1000) % 10000), 4, 1);
323
                write_ndigit_number_u (15, ij+1, (uint16_t)((lat/1000) % 10000), 4, 1);
Line 328... Line 328...
328
                timer = TIMEOUT;
328
                timer = TIMEOUT;
Line 329... Line 329...
329
 
329
 
330
        get_key_press(KEY_ALL);
330
        get_key_press(KEY_ALL);
331
        lcd_cls();
331
        lcd_cls();
-
 
332
}
-
 
333
void Show_LastPosition(void)
-
 
334
{
-
 
335
  lcd_puts_at(0, 5, strGet(START_LASTPOS1), 0);
-
 
336
  uint32_t lon = last5pos[0].Latitude;
-
 
337
  write_ndigit_number_u (1, 6, (uint16_t)(lon/10000000), 2, 0);
-
 
338
  lcd_printp_at (3, 6, PSTR("."), 0);
-
 
339
  write_ndigit_number_u (4, 6, (uint16_t)((lon/1000) % 10000), 4, 1);
-
 
340
  write_ndigit_number_u (8, 6, (uint16_t)((lon/10) % 100), 2, 1);
-
 
341
 
-
 
342
  uint32_t lat = last5pos[0].Longitude;
-
 
343
  write_ndigit_number_u (12, 6, (uint16_t)(lat/10000000), 2, 0);
-
 
344
  lcd_printp_at (14, 6, PSTR("."), 0);
-
 
345
  write_ndigit_number_u (15, 6, (uint16_t)((lat/1000) % 10000), 4, 1);
-
 
346
  write_ndigit_number_u (19, 6, (uint16_t)((lat/10) % 100), 2, 1);
-
 
347
 
-
 
348
}
-
 
349
 
-
 
350
void OSD_Timeout(uint8_t flag)
-
 
351
{
-
 
352
 
-
 
353
//  uint8_t flag;
-
 
354
  uint8_t tmp_dat;
-
 
355
 // flag = 0;
-
 
356
  timer = TIMEOUT;
-
 
357
  // disable OSD Data from NC
-
 
358
  //      RS232_request_mk_data (1, 'o', 0);
-
 
359
//  tmp_dat = 0;
-
 
360
//  SendOutData ('o', ADDRESS_NC, 1, &tmp_dat, 1);
-
 
361
 
-
 
362
  mode = 0;
-
 
363
  rxd_buffer_locked = FALSE;
-
 
364
 
-
 
365
 
-
 
366
  // Bei Verbindungsverlusst werden hier die letzten bekannten Koordinaten ausgegeben!!!
-
 
367
//  if (!timer)
-
 
368
//  {       // timeout occured
-
 
369
          if (flag)
-
 
370
          {
-
 
371
                  // Falls Spannungswarnung an war Beeper aus//
-
 
372
                  BeepTime = 0;
-
 
373
                  BeepMuster = 0xFFFF;
-
 
374
 
-
 
375
                  lcd_cls ();
-
 
376
                  WriteLastPosition(last5pos[0].Longitude,last5pos[0].Latitude);  // im EEprom speichern
-
 
377
                  lcd_puts_at(0, 0, strGet(OSD_ERROR), 2);
-
 
378
 
-
 
379
//                      lcd_printp_at (0, 0, PSTR(" ERROR: Datenverlust "), 2);
-
 
380
 
-
 
381
//                      lcd_printp_at (0, 2, PSTR("Letzte bekannte"), 0);
-
 
382
//                      lcd_printp_at (0, 3, PSTR("Position gespeichert."), 0);
-
 
383
                  lcd_puts_at(0, 2, strGet(OSD_POS1), 0);
-
 
384
                  lcd_puts_at(0, 3, strGet(OSD_POS2), 0);
-
 
385
//                      lcd_printp_at (19, 7, PSTR("OK"), 0);
-
 
386
                  lcd_puts_at(19, 7, strGet(OK), 0);
-
 
387
//                      lcd_printp_at (0, 5, PSTR(" Breitengr  Längengr "), 0);
-
 
388
 
-
 
389
                  lcd_puts_at(0, 5, strGet(START_LASTPOS1), 0);
-
 
390
 
-
 
391
                  lcd_puts_at(12, 7, strGet(ENDE), 0);
-
 
392
 
-
 
393
                  BeepTime = 250;
-
 
394
                  BeepMuster = 0x0080;
-
 
395
                  error = 1;
-
 
396
 
-
 
397
                  uint32_t lon = last5pos[0].Latitude;
-
 
398
                  write_ndigit_number_u (1, 6, (uint16_t)(lon/10000000), 2, 0);
-
 
399
                  lcd_printp_at (3, 6, PSTR("."), 0);
-
 
400
                  write_ndigit_number_u (4, 6, (uint16_t)((lon/1000) % 10000), 4, 1);
-
 
401
                  write_ndigit_number_u (8, 6, (uint16_t)((lon/10) % 100), 2, 1);
-
 
402
 
-
 
403
                  uint32_t lat = last5pos[0].Longitude;
-
 
404
                  write_ndigit_number_u (12, 6, (uint16_t)(lat/10000000), 2, 0);
-
 
405
                  lcd_printp_at (14, 6, PSTR("."), 0);
-
 
406
                  write_ndigit_number_u (15, 6, (uint16_t)((lat/1000) % 10000), 4, 1);
-
 
407
                  write_ndigit_number_u (19, 6, (uint16_t)((lat/10) % 100), 2, 1);
-
 
408
 
-
 
409
//                  while (!get_key_press (1 << KEY_ENTER));
-
 
410
                  _delay_ms(1000);
-
 
411
                  timer = TIMEOUT;
-
 
412
                  lcd_cls();
-
 
413
//                  return;
-
 
414
 
-
 
415
 
-
 
416
          }
-
 
417
          else
-
 
418
            {
-
 
419
              lcd_puts_at(0, 0, strGet(OSD_ERROR), 2);
-
 
420
              Show_LastPosition();
-
 
421
              BeepTime = 250;
-
 
422
              BeepMuster = 0x0080;
-
 
423
            }
-
 
424
//  }
-
 
425
                  SwitchToNC();
-
 
426
 
-
 
427
                  mode = 'O';
-
 
428
 
-
 
429
                  // disable debug...
-
 
430
                  //      RS232_request_mk_data (0, 'd', 0);
-
 
431
                  tmp_dat = 0;
-
 
432
                  SendOutData ('d', ADDRESS_ANY, 1, &tmp_dat, 1);
-
 
433
 
-
 
434
                  // request OSD Data from NC every 100ms
-
 
435
                  //      RS232_request_mk_data (1, 'o', 100);
-
 
436
                  tmp_dat = 10;
-
 
437
                  SendOutData ('o', ADDRESS_NC, 1, &tmp_dat, 1);
-
 
438
 
-
 
439
 
-
 
440
}
-
 
441
 
Line 332... Line 442...
332
}
442
 
333
 
443
 
334
 
444
 
Line 351... Line 461...
351
        uint8_t old_FCFlags = 0;
461
        uint8_t old_FCFlags = 0;
Line 352... Line 462...
352
 
462
 
353
        uint16_t old_hh = 0;
463
        uint16_t old_hh = 0;
354
        uint8_t old_AngleNick = 0;
464
        uint8_t old_AngleNick = 0;
355
        uint8_t old_AngleRoll = 0;
465
        uint8_t old_AngleRoll = 0;
356
 
466
        lcd_cls();
Line 357... Line 467...
357
        OSD_Mode = ShowMode;
467
        OSD_Mode = ShowMode;
358
 
468
 
Line 359... Line 469...
359
        if(error == 0)
469
//      if(error == 0)
360
                lcd_cls();
470
//              lcd_cls();
361
 
471
 
362
        if (hardware == FC)
472
        if (hardware == FC)
Line 623... Line 733...
623
                                SendOutData ('o', ADDRESS_NC, 1, &tmp_dat, 1);
733
                                SendOutData ('o', ADDRESS_NC, 1, &tmp_dat, 1);
Line 624... Line 734...
624
 
734
 
625
                                abo_timer = ABO_TIMEOUT;
735
                                abo_timer = ABO_TIMEOUT;
626
                        }
736
                        }
-
 
737
                }
-
 
738
            if (!timer)
-
 
739
              {
-
 
740
                OSD_Timeout(flag);
-
 
741
                flag = 0;
627
                }
742
              }
628
        }
-
 
629
        while (!get_key_press (1 << KEY_ESC) && timer);
-
 
630
 
-
 
631
        get_key_press(KEY_ALL);
-
 
632
 
-
 
633
 
-
 
634
        // disable OSD Data from NC
-
 
635
        //      RS232_request_mk_data (1, 'o', 0);
-
 
636
        tmp_dat = 0;
-
 
637
        SendOutData ('o', ADDRESS_NC, 1, &tmp_dat, 1);
-
 
638
 
-
 
639
        mode = 0;
-
 
640
        rxd_buffer_locked = FALSE;
-
 
Line -... Line 743...
-
 
743
        }
-
 
744
 
-
 
745
        while (!get_key_press (1 << KEY_ESC));
-
 
746
//        while (!get_key_press (1 << KEY_ESC) && timer);
-
 
747
//      get_key_press(KEY_ALL);
-
 
748
//
-
 
749
//
-
 
750
//      // disable OSD Data from NC
-
 
751
//      //      RS232_request_mk_data (1, 'o', 0);
-
 
752
//      tmp_dat = 0;
-
 
753
//      SendOutData ('o', ADDRESS_NC, 1, &tmp_dat, 1);
-
 
754
//
-
 
755
//      mode = 0;
-
 
756
//      rxd_buffer_locked = FALSE;
641
 
757
//
642
 
758
//
643
        // Bei Verbindungsverlusst werden hier die letzten bekannten Koordinaten ausgegeben!!!
759
//      // Bei Verbindungsverlusst werden hier die letzten bekannten Koordinaten ausgegeben!!!
644
        if (!timer)
760
//      if (!timer)
645
        {       // timeout occured
761
//      {       // timeout occured
646
                if (flag)
762
//              if (flag)
647
                {
763
//              {
648
                        // Falls Spannungswarnung an war Beeper aus//
764
//                      // Falls Spannungswarnung an war Beeper aus//
649
                        BeepTime = 0;
765
//                      BeepTime = 0;
650
                        BeepMuster = 0xFFFF;
766
//                      BeepMuster = 0xFFFF;
651
 
767
//
652
                        lcd_cls ();
768
//                      lcd_cls ();
653
                        WriteLastPosition(last5pos[0].Longitude,last5pos[0].Latitude);  // im EEprom speichern
769
//                      WriteLastPosition(last5pos[0].Longitude,last5pos[0].Latitude);  // im EEprom speichern
654
                        lcd_puts_at(0, 0, strGet(OSD_ERROR), 2);
770
//                      lcd_puts_at(0, 0, strGet(OSD_ERROR), 2);
655
 
771
//
656
//                      lcd_printp_at (0, 0, PSTR(" ERROR: Datenverlust "), 2);
772
////                    lcd_printp_at (0, 0, PSTR(" ERROR: Datenverlust "), 2);
657
 
773
//
658
//                      lcd_printp_at (0, 2, PSTR("Letzte bekannte"), 0);
774
////                    lcd_printp_at (0, 2, PSTR("Letzte bekannte"), 0);
659
//                      lcd_printp_at (0, 3, PSTR("Position gespeichert."), 0);
775
////                    lcd_printp_at (0, 3, PSTR("Position gespeichert."), 0);
660
                        lcd_puts_at(0, 2, strGet(OSD_POS1), 0);
776
//                        lcd_puts_at(0, 2, strGet(OSD_POS1), 0);
661
                        lcd_puts_at(0, 3, strGet(OSD_POS2), 0);
777
//                        lcd_puts_at(0, 3, strGet(OSD_POS2), 0);
662
//                      lcd_printp_at (19, 7, PSTR("OK"), 0);
778
////                    lcd_printp_at (19, 7, PSTR("OK"), 0);
663
                        lcd_puts_at(19, 7, strGet(OK), 0);
779
//                        lcd_puts_at(19, 7, strGet(OK), 0);
664
//                      lcd_printp_at (0, 5, PSTR(" Breitengr  Längengr "), 0);
780
////                    lcd_printp_at (0, 5, PSTR(" Breitengr  Längengr "), 0);
665
 
781
//
666
                        lcd_puts_at(0, 5, strGet(START_LASTPOS1), 0);
782
//                      lcd_puts_at(0, 5, strGet(START_LASTPOS1), 0);
667
 
783
//
668
                        lcd_puts_at(12, 7, strGet(ENDE), 0);
784
//                      lcd_puts_at(12, 7, strGet(ENDE), 0);
669
 
785
//
670
                        BeepTime = 1500;
786
//                      BeepTime = 1500;
671
                        BeepMuster = 0x0040;
787
//                      BeepMuster = 0x0040;
672
                        error = 1;
788
//                      error = 1;
673
 
789
//
674
                        uint32_t lon = last5pos[0].Longitude;
790
//                      uint32_t lon = last5pos[0].Longitude;
675
                        write_ndigit_number_u (1, 6, (uint16_t)(lon/10000000), 2, 0);
791
//                      write_ndigit_number_u (1, 6, (uint16_t)(lon/10000000), 2, 0);
676
                        lcd_printp_at (3, 6, PSTR("."), 0);
792
//                      lcd_printp_at (3, 6, PSTR("."), 0);
677
                        write_ndigit_number_u (4, 6, (uint16_t)((lon/1000) % 10000), 4, 1);
793
//                      write_ndigit_number_u (4, 6, (uint16_t)((lon/1000) % 10000), 4, 1);
678
                        write_ndigit_number_u (8, 6, (uint16_t)((lon/10) % 100), 2, 1);
794
//                      write_ndigit_number_u (8, 6, (uint16_t)((lon/10) % 100), 2, 1);
679
 
795
//
680
                        uint32_t lat = last5pos[0].Latitude;
796
//                      uint32_t lat = last5pos[0].Latitude;
681
                        write_ndigit_number_u (12, 6, (uint16_t)(lat/10000000), 2, 0);
797
//                      write_ndigit_number_u (12, 6, (uint16_t)(lat/10000000), 2, 0);
682
                        lcd_printp_at (14, 6, PSTR("."), 0);
798
//                      lcd_printp_at (14, 6, PSTR("."), 0);
683
                        write_ndigit_number_u (15, 6, (uint16_t)((lat/1000) % 10000), 4, 1);
799
//                      write_ndigit_number_u (15, 6, (uint16_t)((lat/1000) % 10000), 4, 1);
684
                        write_ndigit_number_u (19, 6, (uint16_t)((lat/10) % 100), 2, 1);
800
//                      write_ndigit_number_u (19, 6, (uint16_t)((lat/10) % 100), 2, 1);
685
 
801
//
686
                        while (!get_key_press (1 << KEY_ENTER));
802
//                      while (!get_key_press (1 << KEY_ENTER));
687
 
803
//
688
                        timer = TIMEOUT;
804
//                      timer = TIMEOUT;
689
                        lcd_cls();
805
//                      lcd_cls();
690
                        return;
806
//                      return;
691
 
807
//
692
                }
808
//              }