Subversion Repositories NaviCtrl

Rev

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

Rev 611 Rev 618
Line 81... Line 81...
81
#define SPI0_TIMEOUT     2500  //ms
81
#define SPI0_TIMEOUT     2500  //ms
82
volatile u32 SPI0_Timeout = 0;
82
volatile u32 SPI0_Timeout = 0;
83
u8 Logging_FCStatusFlags1 = 0,Logging_FCStatusFlags2 = 0;
83
u8 Logging_FCStatusFlags1 = 0,Logging_FCStatusFlags2 = 0;
84
u8 SpeakHoTT = 0;
84
u8 SpeakHoTT = 0;
85
u32 LoggingGasFilter = 0, LoggingGasCnt = 0;
85
u32 LoggingGasFilter = 0, LoggingGasCnt = 0;
-
 
86
u8 Out1TriggerUpdateBlocked = 0;
-
 
87
u8 Out1TriggerUpdateNewData = 0;
Line 86... Line 88...
86
 
88
 
87
// tx packet buffer
89
// tx packet buffer
88
#define SPI_TXBUFFER_LEN (2 + sizeof(ToFlightCtrl)) // 2 bytes at start are for synchronization
90
#define SPI_TXBUFFER_LEN (2 + sizeof(ToFlightCtrl)) // 2 bytes at start are for synchronization
89
volatile u8 SPI_TxBuffer[SPI_TXBUFFER_LEN + 10];
91
volatile u8 SPI_TxBuffer[SPI_TXBUFFER_LEN + 10];
Line 427... Line 429...
427
                                if(FC_WP_EventChannel > 254) FC_WP_EventChannel = 254;    // Muss in SPI_NCCMD_GPSINFO bleiben! (siehe oben)
429
                                if(FC_WP_EventChannel > 254) FC_WP_EventChannel = 254;    // Muss in SPI_NCCMD_GPSINFO bleiben! (siehe oben)
428
                                if(FC_WP_EventChannel)
430
                                if(FC_WP_EventChannel)
429
                                 {
431
                                 {
430
                                  LogFC_WP_EventChannel = FC_WP_EventChannel; // to make sure that it will be logged
432
                                  LogFC_WP_EventChannel = FC_WP_EventChannel; // to make sure that it will be logged
431
                                  NaviData_WP.WP_Eventchannel = FC_WP_EventChannel; // to make sure that it will be logged
433
                                  NaviData_WP.WP_Eventchannel = FC_WP_EventChannel; // to make sure that it will be logged
-
 
434
  Out1TriggerUpdateBlocked = 3; // makes sure that the right trigger-pos is sent in command 18
-
 
435
  NaviData_Out1Trigger.Longitude = NaviData.CurrentPosition.Longitude;
-
 
436
  NaviData_Out1Trigger.Latitude = NaviData.CurrentPosition.Latitude;
432
                                 }
437
                                 }
433
                                FC_WP_EventChannel_Processed = 1;
438
                                FC_WP_EventChannel_Processed = 1;
434
  // ++++++++++++++++++++++++++++++++++
439
  // ++++++++++++++++++++++++++++++++++
435
  // Waypoint event +++++++++++++++++++
440
  // Waypoint event +++++++++++++++++++
436
  // ++++++++++++++++++++++++++++++++++
441
  // ++++++++++++++++++++++++++++++++++
Line 688... Line 693...
688
//0x40
693
//0x40
689
//0x20
694
//0x20
690
//0x10
695
//0x10
691
if(FromFlightCtrl.Param.Byte[2] & 0x80) // this Flag marks a changed Out1
696
if(FromFlightCtrl.Param.Byte[2] & 0x80) // this Flag marks a changed Out1
692
 {
697
 {
-
 
698
  Out1TriggerUpdateNewData = 1;
-
 
699
  if(!Out1TriggerUpdateBlocked)
-
 
700
   {
693
                NaviData_Out1Trigger.Longitude = NaviData.CurrentPosition.Longitude;
701
                NaviData_Out1Trigger.Longitude = NaviData.CurrentPosition.Longitude;
694
                NaviData_Out1Trigger.Latitude = NaviData.CurrentPosition.Latitude;
702
                NaviData_Out1Trigger.Latitude = NaviData.CurrentPosition.Latitude;
-
 
703
   }
695
                NaviData_Out1Trigger.Altimeter = NaviData.Altimeter;
704
  Out1TriggerUpdateBlocked = 0;
696
 }
705
 }
-
 
706
if(Out1TriggerUpdateBlocked) Out1TriggerUpdateBlocked--;
697
                                index = FromFlightCtrl.Param.Byte[2] & 0x0f; //MAX_MOTORS
707
                                index = FromFlightCtrl.Param.Byte[2] & 0x0f; //MAX_MOTORS
698
                                Motor[index].NotReadyCnt = FromFlightCtrl.Param.Byte[6];
708
                                Motor[index].NotReadyCnt = FromFlightCtrl.Param.Byte[6];
699
                                Motor_Version[index] = FromFlightCtrl.Param.Byte[7];
709
                                Motor_Version[index] = FromFlightCtrl.Param.Byte[7];
700
                                Motor[index].MaxPWM = FromFlightCtrl.Param.Byte[8];
710
                                Motor[index].MaxPWM = FromFlightCtrl.Param.Byte[8];
701
                                Motor[index].State = FromFlightCtrl.Param.Byte[9];
711
                                Motor[index].State = FromFlightCtrl.Param.Byte[9];