Subversion Repositories NaviCtrl

Rev

Rev 740 | Rev 785 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 740 Rev 780
Line 72... Line 72...
72
#include "sdc.h"
72
#include "sdc.h"
73
#include "analog.h"
73
#include "analog.h"
74
#include "canbus.h"
74
#include "canbus.h"
75
#include "triggerlog.h"
75
#include "triggerlog.h"
76
#include "CamCtrl.h"
76
#include "CamCtrl.h"
-
 
77
#include "eeprom.h"
Line 77... Line 78...
77
 
78
 
78
u8 DispPtr = 0;
79
u8 DispPtr = 0;
Line 79... Line 80...
79
s8 DisplayBuff[DISPLAYBUFFSIZE];
80
s8 DisplayBuff[DISPLAYBUFFSIZE];
80
 
81
 
Line 81... Line 82...
81
 
82
 
82
u8 MenuItem = 0;
83
u8 MenuItem = 0;
83
u8 MaxMenuItem = 30;
84
u8 MaxMenuItem = 31;
84
 
85
 
Line 696... Line 697...
696
                        {
697
                        {
697
                                if(FromCamCtrl.PPM2Okay) LCD_printfxy(10,3,"PPM:%3i",FromCamCtrl.PPM2Data);
698
                                if(FromCamCtrl.PPM2Okay) LCD_printfxy(10,3,"PPM:%3i",FromCamCtrl.PPM2Data);
698
                        }
699
                        }
699
                  }
700
                  }
700
                        break;
701
                        break;
-
 
702
                case 31: // Temperaturecompensation of the Barosensor
-
 
703
                {
-
 
704
                static s32 dT = 0, tAlt = 0, faktor = 0;
-
 
705
                static s32 dP = 0, pAlt = 0;
-
 
706
                static u8 stored = 0, heateroff_msg = 0;
-
 
707
 
-
 
708
                        if(BaroCalState)
-
 
709
                        {
-
 
710
                                dP = NaviData.Altimeter_5cm/2 - pAlt;
-
 
711
                                dT = FC_Temperatur - tAlt;
-
 
712
                                faktor = (dP * 100) / dT;
-
 
713
 
-
 
714
                                if(abs(dT) < 130)                                                       LCD_printfxy(0,0,"Warm up slowly")
-
 
715
                                else
-
 
716
                                if(FC.StatusFlags & FC_STATUS_MOTOR_RUN)        LCD_printfxy(0,0,"Motors off!   ")
-
 
717
                                else                                                                    LCD_printfxy(0,0,"Wait...       ");
-
 
718
 
-
 
719
                                if((abs(FC_Temperatur_raw/10 - tAlt) >= 250))           heateroff_msg = 1;
-
 
720
                                if((abs(FC_Temperatur_raw/10 - tAlt) <= 150))           heateroff_msg = 0;
-
 
721
                                if(heateroff_msg) LCD_printfxy(0,0,"Heater off!   ");
-
 
722
 
-
 
723
                                LCD_printfxy(0,1,"T=%4dC   dT=%3dC ",FC_Temperatur_raw/100,dT/10 );
-
 
724
                                LCD_printfxy(0,2,"P=%4dm   dP=%3dm ",NaviData.Altimeter_5cm/20,dP/10 );
-
 
725
 
-
 
726
                                if(dT > 30) LCD_printfxy(0,3,"K=%4dcm/C ",faktor)
-
 
727
                                else LCD_printfxy(0,3,"       (cancel)",faktor);
-
 
728
 
-
 
729
                                if(abs(dT) > 120 && (abs(FC_Temperatur_raw/10 - FC_Temperatur) <= 5))  // kein Temperaturgradient und mehr als 12°C erwärmt
-
 
730
                                 {
-
 
731
                                  heateroff_msg = 0;
-
 
732
                                  LCD_printfxy(12,3,"(save)");
-
 
733
                                  LCD_printfxy(0,0,"Okay          ");
-
 
734
 
-
 
735
                                  if(Keys & KEY4) //  Store
-
 
736
                                  {
-
 
737
                                        LuftdruckTemperaturKompensation = faktor;
-
 
738
                                        WriteBaroCalibrationToEEprom();
-
 
739
                                BaroCalState = 0;
-
 
740
                                        stored = 1;
-
 
741
                                  }
-
 
742
                                 }
-
 
743
                                else LCD_printfxy(15,3,"(--)  ");
-
 
744
                        }
-
 
745
                        else
-
 
746
                        if(UART_VersionInfo.HWMajor >= 30)
-
 
747
                        {
-
 
748
                                LCD_printfxy(0,0,"Barometer");
-
 
749
                                LCD_printfxy(0,1,"Temperat.= %4d.%1dC ",FC_Temperatur_raw/100,abs(FC_Temperatur_raw%100)/10);
-
 
750
                                LCD_printfxy(0,2,"Faktor   = %4dcm/C ",LuftdruckTemperaturKompensation);
-
 
751
//LCD_printfxy(0,3,"Offset =%4dcm ",LuftdruckTemperaturOffset);
-
 
752
                            if(stored) LCD_printfxy(0,3,"Stored     ");
-
 
753
 
-
 
754
                                if((abs(FC_Temperatur_raw/10 - FC_Temperatur) <= 5))  // kein Temperaturgradient
-
 
755
                                 {
-
 
756
                                        LCD_printfxy(15,3,"(CAL)");
-
 
757
                                        if(Keys & KEY4) //  next step
-
 
758
                                        {
-
 
759
                                                pAlt = NaviData.Altimeter_5cm/2;
-
 
760
                                                tAlt = FC_Temperatur_raw/10;
-
 
761
                                                FC_Temperatur = FC_Temperatur_raw/10;
-
 
762
                                                BaroCalState = 1;
-
 
763
                                                stored = 0;
-
 
764
                                        }
-
 
765
 
-
 
766
                                 }
-
 
767
                                else LCD_printfxy(15,3,"(---)");
-
 
768
                        }
-
 
769
                        else
-
 
770
                        {
-
 
771
                                LCD_printfxy(0,0,"Barometer");
-
 
772
                                LCD_printfxy(0,1,"Temperat = ??C ");
-
 
773
                                LCD_printfxy(0,2,"Faktor   = ?? cm/C");
-
 
774
                                LCD_printfxy(0,3,"Not supported");
-
 
775
                        }
-
 
776
 
-
 
777
                        if(Keys & KEY3)  BaroCalState = 0;  // cancel
-
 
778
                        }
-
 
779
                        break;
-
 
780
 
-
 
781
 
Line 701... Line 782...
701
 
782
 
702
                default:
783
                default:
703
                        //MaxMenuItem = MenuItem - 1;
784
                        //MaxMenuItem = MenuItem - 1;
704
                        MenuItem = 0;
785
                        MenuItem = 0;