Subversion Repositories FlightCtrl

Rev

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

Rev 157 Rev 158
Line 439... Line 439...
439
         static unsigned int  modell_fliegt = 0;
439
         static unsigned int  modell_fliegt = 0;
440
     static int hoehenregler = 0;
440
     static int hoehenregler = 0;
441
     static char TimerWerteausgabe = 0;
441
     static char TimerWerteausgabe = 0;
442
     static char NeueKompassRichtungMerken = 0;
442
     static char NeueKompassRichtungMerken = 0;
443
        Mittelwert();
443
        Mittelwert();
444
//******PROVISORISCH***************
444
//****** GPS Daten holen ***************
445
        short int n;
445
        short int n;
446
        n = Get_Rel_Position();
446
        n = Get_Rel_Position();
447
        if (n == 0)    
447
        if (n == 0)    
448
        {
448
        {
449
                ROT_ON;
-
 
450
//              gps_act_position.status         = 0;
449
                ROT_ON; //led blitzen lassen
451
        }
450
        }
Line 452... Line 451...
452
 
451
 
453
//******PROVISORISCH***************
452
//******PROVISORISCH***************
Line 535... Line 534...
535
                          if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset();
534
                          if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset();
536
                        }  
535
                        }  
537
                                                GPS_Save_Home(); //Daten sind jetzt hoffentlich verfuegbar
536
                                                GPS_Save_Home(); //Daten sind jetzt hoffentlich verfuegbar
538
                                                if (gps_home_position.status > 0 )
537
                                                if (gps_home_position.status > 0 )
539
                                                {
538
                                                {
540
                                                        Delay_ms(500);  //akustisch verkuenden dass GPS Home Daten da sind
539
                                                        Delay_ms(1000);  //akustisch verkuenden dass GPS Home Daten da sind
541
                                                        beeptime = 1000;
540
                                                        beeptime = 2000;
542
                                                        Delay_ms(500);
541
                                                        Delay_ms(500);
543
                                                }
542
                                                }
544
                       }
543
                       }
545
                    }
544
                    }
546
                 else delay_neutral = 0;
545
                 else delay_neutral = 0;
Line 762... Line 761...
762
           }
761
           }
763
           else magkompass_ok = 0;
762
           else magkompass_ok = 0;
764
        }
763
        }
765
// Salvo End *************************
764
// Salvo End *************************
Line -... Line 765...
-
 
765
 
-
 
766
// Salvo 15.9.2007 GPS Hold Aktiveren mit dem Hoehenschalter aber nur wenn Knueppel in Ruhelage sind
-
 
767
 if  ((Parameter_MaxHoehe > 200) && ( (abs(StickRoll)) < GPS_STICK_HOLDOFF) && ( (abs(StickNick)) < GPS_STICK_HOLDOFF))
-
 
768
 {
-
 
769
        short int n;
-
 
770
        n= GPS_CRTL(GPS_CMD_REQ_HOLD);
-
 
771
 }
-
 
772
 else
-
 
773
 {
-
 
774
        n= GPS_CRTL(GPS_CMD_STOP_HOLD);
Line 766... Line 775...
766
 
775
 }
767
 
776
 
768
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                
777
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                
769
//  Kompass
778
//  Kompass
Line 813... Line 822...
813
    DebugOut.Analog[2] = Mittelwert_AccNick;
822
    DebugOut.Analog[2] = Mittelwert_AccNick;
814
    DebugOut.Analog[3] = Mittelwert_AccRoll;
823
    DebugOut.Analog[3] = Mittelwert_AccRoll;
815
    DebugOut.Analog[4] = MesswertGier;
824
    DebugOut.Analog[4] = MesswertGier;
816
    DebugOut.Analog[5] = HoehenWert;
825
    DebugOut.Analog[5] = HoehenWert;
817
    DebugOut.Analog[6] = (Mess_Integral_Hoch / 512);
826
    DebugOut.Analog[6] = (Mess_Integral_Hoch / 512);
-
 
827
/*
818
    DebugOut.Analog[7] = GasMischanteil;
828
    DebugOut.Analog[7] = GasMischanteil;
819
    DebugOut.Analog[8] = KompassValue;
829
    DebugOut.Analog[8] = KompassValue;
-
 
830
*/
-
 
831
 
-
 
832
        DebugOut.Analog[7] =  gps_rel_act_position.utm_east;
-
 
833
        DebugOut.Analog[8] =  gps_rel_act_position.utm_north;
-
 
834
 
-
 
835
        DebugOut.Analog[9] =  gps_rel_hold_position.utm_east;
-
 
836
        DebugOut.Analog[10] = gps_rel_hold_position.utm_north;
-
 
837
        DebugOut.Analog[11] = GPS_hdng_abs_2trgt;
Line 820... Line -...
820
 
-
 
821
        DebugOut.Analog[9] =  gps_rel_act_position.utm_east;
-
 
822
        DebugOut.Analog[10] = gps_rel_act_position.utm_north;
-
 
Line 823... Line 838...
823
        DebugOut.Analog[11] = gps_rel_act_position.status;
838
 
824
 
839
 
825
// ******provisorisch
840
// ******provisorisch
826
//    DebugOut.Analog[9]  = cnt1;       
841
//    DebugOut.Analog[9]  = cnt1;       
Line 876... Line 891...
876
 if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG))  // Höhenregelung
891
 if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG))  // Höhenregelung
877
  {
892
  {
878
    int tmp_int;
893
    int tmp_int;
879
    if(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER)  // Regler wird über Schalter gesteuert
894
    if(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER)  // Regler wird über Schalter gesteuert
880
    {
895
    {
-
 
896
// Salvo 15.9.2007 Grenzwert fuer Hoehenschalter kleiner, damit 
-
 
897
// mit dem Schalter die Zusatende AUS- Hoehenregler AN -- Hoehenreger und GPS an
-
 
898
//durchlaufen werden koennen
881
     if(Parameter_MaxHoehe < 50)
899
     if(Parameter_MaxHoehe < 50)
-
 
900
// Salvo End
882
      {
901
      {
883
       SollHoehe = HoehenWert - 20;  // Parameter_MaxHoehe ist der PPM-Wert des Schalters
902
       SollHoehe = HoehenWert - 20;  // Parameter_MaxHoehe ist der PPM-Wert des Schalters
884
       HoehenReglerAktiv = 0;
903
       HoehenReglerAktiv = 0;
885
      }
904
      }
886
      else  
905
      else