Subversion Repositories NaviCtrl

Rev

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

Rev 326 Rev 327
Line 284... Line 284...
284
                // avoid sending data via SPI during the update of the  ToFlightCtrl structure
284
                // avoid sending data via SPI during the update of the  ToFlightCtrl structure
285
                VIC_ITCmd(SSP0_ITLine, DISABLE); // disable SPI interrupt
285
                VIC_ITCmd(SSP0_ITLine, DISABLE); // disable SPI interrupt
286
                ToFlightCtrl.CompassHeading = Compass_Heading;
286
                ToFlightCtrl.CompassHeading = Compass_Heading;
287
                DebugOut.Analog[10] = ToFlightCtrl.CompassHeading;
287
                DebugOut.Analog[10] = ToFlightCtrl.CompassHeading;
288
                if(ToFlightCtrl.CompassHeading >= 0) ToFlightCtrl.CompassHeading = (360 + ToFlightCtrl.CompassHeading + FromFlightCtrl.GyroYaw / 12) % 360;
288
                if(ToFlightCtrl.CompassHeading >= 0) ToFlightCtrl.CompassHeading = (360 + ToFlightCtrl.CompassHeading + FromFlightCtrl.GyroYaw / 12) % 360;
289
                ToFlightCtrl.MagVecX = MagVector.X;
289
//              ToFlightCtrl.MagVecX = MagVector.X;
290
                ToFlightCtrl.MagVecY = MagVector.Y;
290
//              ToFlightCtrl.MagVecY = MagVector.Y;
291
                ToFlightCtrl.MagVecZ = MagVector.Z;
291
                ToFlightCtrl.MagVecZ = MagVector.Z;
292
                ToFlightCtrl.NCStatus = 0;
292
                ToFlightCtrl.NCStatus = 0;
293
                // cycle spi commands
293
                // cycle spi commands
294
                ToFlightCtrl.Command = SPI_CommandSequence[SPI_CommandCounter++];
294
                ToFlightCtrl.Command = SPI_CommandSequence[SPI_CommandCounter++];
295
                // restart command cycle at the end
295
                // restart command cycle at the end
Line 406... Line 406...
406
                                }
406
                                }
407
                                else
407
                                else
408
                                {
408
                                {
409
                                        FCCalibActive = 0;
409
                                        FCCalibActive = 0;
410
                                }
410
                                }
-
 
411
 if(FC.StatusFlags & FC_STATUS_START)
411
 if(FC.StatusFlags & FC_STATUS_START) if(Compass_Heading != -1) HeadFreeStartAngle = Compass_Heading * 10; else HeadFreeStartAngle = FromFlightCtrl.GyroHeading;
412
     { if(Compass_Heading != -1) HeadFreeStartAngle = Compass_Heading * 10; else HeadFreeStartAngle = FromFlightCtrl.GyroHeading; }
Line 412... Line 413...
412
 
413
 
413
 if((Parameter.ExtraConfig & CFG_LEARNABLE_CAREFREE))
414
 if((Parameter.ExtraConfig & CFG_TEACHABLE_CAREFREE))
414
  {
415
  {
415
   if(!(FC.StatusFlags2 & FC_STATUS2_CAREFREE)) // CF ist jetzt ausgeschaltet -> neue Richtung lernen
416
   if(!(FC.StatusFlags2 & FC_STATUS2_CAREFREE)) // CF ist jetzt ausgeschaltet -> neue Richtung lernen
416
    {
417
    {
417
     if((NaviData.HomePositionDeviation.Distance > 200) && (NCFlags & NC_FLAG_GPS_OK))   // nur bei ausreichender Distance -> 20m
418
     if((NaviData.HomePositionDeviation.Distance > 200) && (NCFlags & NC_FLAG_GPS_OK))   // nur bei ausreichender Distance -> 20m
Line 462... Line 463...
462
                                CHK_POTI_MM(Parameter.NaviGpsACC,FromFlightCtrl.Param.Byte[5],0,255);
463
                                CHK_POTI_MM(Parameter.NaviGpsACC,FromFlightCtrl.Param.Byte[5],0,255);
463
                                Parameter.NaviGpsMinSat = FromFlightCtrl.Param.Byte[6];
464
                                Parameter.NaviGpsMinSat = FromFlightCtrl.Param.Byte[6];
464
                                Parameter.NaviStickThreshold = FromFlightCtrl.Param.Byte[7];
465
                                Parameter.NaviStickThreshold = FromFlightCtrl.Param.Byte[7];
465
                                CHK_POTI_MM(Parameter.NaviOperatingRadius,FromFlightCtrl.Param.Byte[8],0,255);
466
                                CHK_POTI_MM(Parameter.NaviOperatingRadius,FromFlightCtrl.Param.Byte[8],0,255);
466
                                CHK_POTI_MM(Parameter.NaviWindCorrection,FromFlightCtrl.Param.Byte[9],0,255);
467
                                CHK_POTI_MM(Parameter.NaviWindCorrection,FromFlightCtrl.Param.Byte[9],0,255);
467
                                CHK_POTI_MM(Parameter.NaviSpeedCompensation,FromFlightCtrl.Param.Byte[10],0,255);
468
                                CHK_POTI_MM(Parameter.NaviAccCompensation,FromFlightCtrl.Param.Byte[10],0,255);
468
                                CHK_POTI_MM(Parameter.NaviAngleLimitation,FromFlightCtrl.Param.Byte[11],0,255);
469
                                CHK_POTI_MM(Parameter.NaviAngleLimitation,FromFlightCtrl.Param.Byte[11],0,255);
469
                                break;
470
                                break;
Line 470... Line 471...
470
 
471
 
471
                        case SPI_FCCMD_STICK:
472
                        case SPI_FCCMD_STICK: