Subversion Repositories FlightCtrl

Rev

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

Rev 2072 Rev 2090
Line 642... Line 642...
642
    if(tmp >= 248 && Poti[255 - tmp] < 50) CareFree = 0;
642
    if(tmp >= 248 && Poti[255 - tmp] < 50) CareFree = 0;
643
    if(carefree_old != CareFree)
643
    if(carefree_old != CareFree)
644
    {
644
    {
645
      if(carefree_old < 3)
645
      if(carefree_old < 3)
646
           {
646
           {
-
 
647
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
-
 
648
                if(CareFree) { beeptime = 1500;  if(!SpeakHoTT) SpeakHoTT = SPEAK_CF_ON; }
-
 
649
            else { beeptime = 200;  if(!SpeakHoTT) SpeakHoTT = SPEAK_CF_OFF; }
-
 
650
#else
647
                if(CareFree) beeptime = 1500;
651
                if(CareFree) beeptime = 1500;
648
            else beeptime = 200;
652
            else beeptime = 200;
-
 
653
#endif
649
                NeueKompassRichtungMerken = 5;
654
                NeueKompassRichtungMerken = 5;
650
        carefree_old = CareFree;
655
        carefree_old = CareFree;
651
           } else carefree_old--;
656
           } else carefree_old--;
652
        }  
657
        }  
653
        if(FromNaviCtrl.CompassValue < 0 && CareFree) VersionInfo.HardwareError[0] |= FC_ERROR0_CAREFREE; //else VersionInfo.HardwareError[0] &= ~FC_ERROR0_CAREFREE;
658
        if(FromNaviCtrl.CompassValue < 0 && CareFree) VersionInfo.HardwareError[0] |= FC_ERROR0_CAREFREE; //else VersionInfo.HardwareError[0] &= ~FC_ERROR0_CAREFREE;
Line 753... Line 758...
753
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
758
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
754
                if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75)  // Neutralwerte
759
                if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75)  // Neutralwerte
755
                    {
760
                    {
756
                    if(++delay_neutral > 200)  // nicht sofort
761
                    if(++delay_neutral > 200)  // nicht sofort
757
                        {
762
                        {
-
 
763
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
758
                        MotorenEin = 0;
764
                                                   SpeakHoTT = SPEAK_CALIBRATE;
-
 
765
#endif
759
                        delay_neutral = 0;
766
                        delay_neutral = 0;
760
                        modell_fliegt = 0;
767
                        modell_fliegt = 0;
761
                        if(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70 || abs(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]) > 70)
768
                        if(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70 || abs(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]) > 70)
762
                        {
769
                        {
763
                         unsigned char setting=1;
770
                         unsigned char setting=1;
Line 838... Line 845...
838
                                                                        SummeNick = 0;
845
                                                                        SummeNick = 0;
839
                                                                        SummeRoll = 0;
846
                                                                        SummeRoll = 0;
840
                                                                        FC_StatusFlags |= FC_STATUS_START;
847
                                                                        FC_StatusFlags |= FC_STATUS_START;
841
//                                                                      ControlHeading = (((int) EE_Parameter.OrientationAngle * 15 + KompassValue) % 360) / 2;
848
//                                                                      ControlHeading = (((int) EE_Parameter.OrientationAngle * 15 + KompassValue) % 360) / 2;
842
                                                                        NeueKompassRichtungMerken = 100; // 2 sekunden
849
                                                                        NeueKompassRichtungMerken = 100; // 2 sekunden
-
 
850
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
-
 
851
                                                                        SpeakHoTT = SPEAK_STARTING;
-
 
852
#endif
843
                                                                }
853
                                                                }
844
                                                                else
854
                                                                else
845
                                                                {
855
                                                                {
846
                                                                        beeptime = 1500; // indicate missing calibration
856
                                                                        beeptime = 1500; // indicate missing calibration
-
 
857
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
-
 
858
                                                                        SpeakHoTT = SPEAK_ERR_CALIBARTION;
-
 
859
#endif
847
                                                                }
860
                                                                }
848
                                                        }
861
                                                        }
849
                                                }
862
                                                }
850
                                                else delay_einschalten = 0;
863
                                                else delay_einschalten = 0;
851
                                        }
864
                                        }
Line 859... Line 872...
859
                                                        if(++delay_ausschalten > 200)  // nicht sofort
872
                                                        if(++delay_ausschalten > 200)  // nicht sofort
860
                                                        {
873
                                                        {
861
                                                                MotorenEin = 0;
874
                                                                MotorenEin = 0;
862
                                                                delay_ausschalten = 0;
875
                                                                delay_ausschalten = 0;
863
                                                                modell_fliegt = 0;
876
                                                                modell_fliegt = 0;
-
 
877
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
-
 
878
                                                                        SpeakHoTT = SPEAK_MK_OFF;
-
 
879
#endif
864
                                                        }
880
                                                        }
865
                                                }
881
                                                }
866
                                                else delay_ausschalten = 0;
882
                                                else delay_ausschalten = 0;
867
                                        }
883
                                        }
868
                }
884
                }
Line 1424... Line 1440...
1424
                {       // check if parameter is less than activation threshold
1440
                {       // check if parameter is less than activation threshold
1425
                        if(Parameter_HoehenSchalter < 50) // for 3 or 2-state switch height control is disabled in lowest position
1441
                        if(Parameter_HoehenSchalter < 50) // for 3 or 2-state switch height control is disabled in lowest position
1426
                        {   //height control not active
1442
                        {   //height control not active
1427
                                if(!delay--)
1443
                                if(!delay--)
1428
                                {
1444
                                {
-
 
1445
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
-
 
1446
                                    if(HoehenReglerAktiv && !SpeakHoTT) SpeakHoTT = SPEAK_ALTITUDE_OFF;
-
 
1447
#endif
1429
                                        HoehenReglerAktiv = 0; // disable height control
1448
                                        HoehenReglerAktiv = 0; // disable height control
1430
                                        SollHoehe = HoehenWert;  // update SetPoint with current reading
1449
                                        SollHoehe = HoehenWert;  // update SetPoint with current reading
1431
                                        delay = 1;
1450
                                        delay = 1;
1432
                                }
1451
                                }
1433
                        }
1452
                        }
1434
                        else
1453
                        else
-
 
1454
                        if(Parameter_HoehenSchalter > 70)
1435
                        {       //height control is activated
1455
                        {       //height control is activated
-
 
1456
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
-
 
1457
                                if(!HoehenReglerAktiv && !SpeakHoTT) SpeakHoTT = SPEAK_ALTITUDE_ON;
-
 
1458
#endif
1436
                                HoehenReglerAktiv = 1; // enable height control
1459
                                HoehenReglerAktiv = 1; // enable height control
1437
                                delay = 200;
1460
                                delay = 200;
1438
                        }
1461
                        }
1439
                }
1462
                }
1440
                else // no switchable height control
1463
                else // no switchable height control
Line 1870... Line 1893...
1870
                        Motor[i].SetPoint = 0;
1893
                        Motor[i].SetPoint = 0;
1871
                        Motor[i].SetPointLowerBits = 0;
1894
                        Motor[i].SetPointLowerBits = 0;
1872
                }
1895
                }
1873
        }
1896
        }
1874
}
1897
}
-
 
1898
//DebugOut.Analog[16]