Subversion Repositories NaviCtrl

Rev

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

Rev 806 Rev 808
Line 278... Line 278...
278
        {
278
        {
279
                LED_RED_ON;
279
                LED_RED_ON;
280
                sprintf(ErrorMSG,"ERR:FC Z-ACC");
280
                sprintf(ErrorMSG,"ERR:FC Z-ACC");
281
                newErrorCode = 15;
281
                newErrorCode = 15;
282
        }
282
        }
283
        else if(NC_To_FC_Flags & NC_TO_FC_FLYING_RANGE)
-
 
284
        {
-
 
285
                LED_RED_ON;
-
 
286
                sprintf(ErrorMSG,"ERR:Flying range!");
-
 
287
                newErrorCode = 28;
-
 
288
        }
-
 
289
        else if(FC.Error[0] & FC_ERROR0_PRESSURE)
283
        else if(FC.Error[0] & FC_ERROR0_PRESSURE)
290
        {
284
        {
291
                LED_RED_ON;
285
                LED_RED_ON;
292
                sprintf(ErrorMSG,"ERR:Pressure sensor");
286
                sprintf(ErrorMSG,"ERR:Pressure sensor");
293
                newErrorCode = 16;
287
                newErrorCode = 16;
Line 364... Line 358...
364
        {
358
        {
365
                LED_RED_ON;
359
                LED_RED_ON;
366
                sprintf(ErrorMSG,"GPS Fix lost    ");
360
                sprintf(ErrorMSG,"GPS Fix lost    ");
367
                newErrorCode = 21;
361
                newErrorCode = 21;
368
        }
362
        }
-
 
363
        else if(NC_To_FC_Flags & NC_TO_FC_FLYING_RANGE)
-
 
364
        {
-
 
365
                LED_RED_ON;
-
 
366
                sprintf(ErrorMSG,"ERR:Flying range!");
-
 
367
                newErrorCode = 28;
-
 
368
        }
369
        else if(ErrorDisturbedEarthMagnetField)
369
        else if(ErrorDisturbedEarthMagnetField)
370
        {
370
        {
371
                LED_RED_ON;
371
                LED_RED_ON;
372
                sprintf(ErrorMSG,"Magnet error    ");
372
                sprintf(ErrorMSG,"Magnet error    ");
373
                newErrorCode = 22;
373
                newErrorCode = 22;
Line 651... Line 651...
651
            else
651
            else
652
            if(FC_Temperatur > FC_Temperatur_raw/10) FC_Temperatur--;
652
            if(FC_Temperatur > FC_Temperatur_raw/10) FC_Temperatur--;
653
            else
653
            else
654
            if(FC_Temperatur < FC_Temperatur_raw/10) FC_Temperatur++;
654
            if(FC_Temperatur < FC_Temperatur_raw/10) FC_Temperatur++;
655
          }
655
          }
656
         if(TryAgain_UBX_Setup) { if(--TryAgain_UBX_Setup == 0) UBX_Setup();}
-
 
Line -... Line 656...
-
 
656
 
-
 
657
// ++++++++++++++++++++++++++++++++++++++++++++++++
-
 
658
// + Re-Init GPS-Module?
-
 
659
// ++++++++++++++++++++++++++++++++++++++++++++++++
-
 
660
        if(Parameter.GlobalConfig & FC_CFG_GPS_AKTIV)
-
 
661
        {
-
 
662
         if(TryAgain_UBX_Setup)
-
 
663
          {
-
 
664
            if(--TryAgain_UBX_Setup == 0) UBX_Setup();
-
 
665
          }
-
 
666
          else
-
 
667
          if(CheckDelay(UBX_Timeout)) // no GPS communication
-
 
668
          {
-
 
669
                   GPS_Version = 0;
-
 
670
                   TryAgain_UBX_Setup = 6; // Re-init GPS-Receiver in x seconds
657
 
671
          }
-
 
672
    }
658
    }
673
  }
659
// ++++++++++++++++++++++++++++++++++++++++++++++++
674
// ++++++++++++++++++++++++++++++++++++++++++++++++
660
        // ---------------- Error Check Timing ----------------------------
675
        // ---------------- Error Check Timing ----------------------------
661
        if(CheckDelay(TimerCheckError) || (FC.StatusFlags & FC_STATUS_START && !(oldFcFlags & FC_STATUS_START))) // Timer or FY wants to start
676
        if(CheckDelay(TimerCheckError) || (FC.StatusFlags & FC_STATUS_START && !(oldFcFlags & FC_STATUS_START))) // Timer or FY wants to start
662
        {
677
        {
Line 800... Line 815...
800
            {
815
            {
801
              if(IamMaster == SLAVE) TryAgain_UBX_Setup = 2;
816
              if(IamMaster == SLAVE) TryAgain_UBX_Setup = 2;
802
                  else TryAgain_UBX_Setup = 4;
817
                  else TryAgain_UBX_Setup = 4;
803
                }
818
                }
804
         }
819
         }
-
 
820
 
805
// +++++++++++++++++++++++++++++++++++++++
821
// +++++++++++++++++++++++++++++++++++++++
806
// ++ check CamCtrl version (if connected)
822
// ++ check CamCtrl version (if connected)
807
        if(Compass_I2CPort == NCMAG_PORT_INTERN)
823
        if(Compass_I2CPort == NCMAG_PORT_INTERN)
808
         {
824
         {
809
          if(I2CBus_LockBuffer(I2C0,3)) I2CBus_Transmission(I2C0, CAM_SLAVE_ADDRESS, &ToCamCtrl, 4, &CamCtrl_UpdateData, sizeof(FromCamCtrl));
825
          if(I2CBus_LockBuffer(I2C0,3)) I2CBus_Transmission(I2C0, CAM_SLAVE_ADDRESS, &ToCamCtrl, 4, &CamCtrl_UpdateData, sizeof(FromCamCtrl));
Line 816... Line 832...
816
        if(Compass_I2CPort == NCMAG_PORT_INTERN)
832
        if(Compass_I2CPort == NCMAG_PORT_INTERN)
817
         {
833
         {
818
          if(I2CBus_LockBuffer(I2C0,3)) I2CBus_Transmission(I2C0, LASER_SLAVE_ADDRESS, &ToLaserCtrl, 4, &LaserCtrl_UpdateData, sizeof(FromLaserCtrl));
834
          if(I2CBus_LockBuffer(I2C0,3)) I2CBus_Transmission(I2C0, LASER_SLAVE_ADDRESS, &ToLaserCtrl, 4, &LaserCtrl_UpdateData, sizeof(FromLaserCtrl));
819
         }
835
         }
820
        else LaserCtrlTimeout = 0; // disable CamCtrl communication if external compass is connected
836
        else LaserCtrlTimeout = 0; // disable CamCtrl communication if external compass is connected
821
// +++++++++++++++++++++++++++++++++++++++
-
 
Line -... Line 837...
-
 
837
 
822
 
838
// +++++++++++++++++++++++++++++++++++++++
-
 
839
        GPS_Init();
823
        GPS_Init();
840
 
824
        // ---------- Prepare the isr driven
841
        // ---------- Prepare the isr driven
825
        // set to absolute lowest priority
842
        // set to absolute lowest priority
826
    VIC_Config(EXTIT3_ITLine, VIC_IRQ, PRIORITY_SW);
843
    VIC_Config(EXTIT3_ITLine, VIC_IRQ, PRIORITY_SW);
827
        // enable interrupts
844
        // enable interrupts
Line 985... Line 1002...
985
                        }
1002
                        }
986
                }
1003
                }
987
*/                                                       
1004
*/                                                       
988
        }
1005
        }
989
}
1006
}
990
//DebugOut.Analog[]
1007
//DebugOut.Analog[]