Subversion Repositories FlightCtrl

Rev

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

Rev 1209 Rev 1215
Line 14... Line 14...
14
 
14
 
15
volatile unsigned char     SPI_Buffer[sizeof(FromNaviCtrl)];
15
volatile unsigned char     SPI_Buffer[sizeof(FromNaviCtrl)];
Line 16... Line 16...
16
unsigned char *SPI_TX_Buffer;
16
unsigned char *SPI_TX_Buffer;
17
 
17
 
Line 18... Line 18...
18
unsigned char SPITransferCompleted, SPI_ChkSum;
18
unsigned char SPITransferCompleted, SPI_ChkSum;
19
unsigned char SPI_RxDataValid;
19
unsigned char SPI_RxDataValid,NaviDataOkay = 0;
Line 20... Line 20...
20
 
20
 
Line 41... Line 41...
41
  ToNaviCtrl.Sync2 = 0x83;
41
  ToNaviCtrl.Sync2 = 0x83;
Line 42... Line 42...
42
 
42
 
43
  ToNaviCtrl.Command = SPI_CMD_USER;
43
  ToNaviCtrl.Command = SPI_CMD_USER;
44
  ToNaviCtrl.IntegralNick = 0;
44
  ToNaviCtrl.IntegralNick = 0;
-
 
45
  ToNaviCtrl.IntegralRoll = 0;
45
  ToNaviCtrl.IntegralRoll = 0;
46
  FromNaviCtrl_Value.SerialDataOkay = 0;
Line 46... Line 47...
46
  SPI_RxDataValid = 0;
47
  SPI_RxDataValid = 0;
47
 
48
 
48
  SPI_VersionInfo.Major = VERSION_MAJOR;
49
  SPI_VersionInfo.Major = VERSION_MAJOR;
Line 238... Line 239...
238
            break;
239
            break;
239
   }
240
   }
Line 240... Line 241...
240
 
241
 
Line 241... Line 242...
241
  sei();
242
  sei();
242
 
243
 
243
  if (SPI_RxDataValid)
244
  if(SPI_RxDataValid)
244
  {
245
  {
245
   if(abs(FromNaviCtrl.GPS_Nick) < 512 && abs(FromNaviCtrl.GPS_Roll) < 512 && (EE_Parameter.GlobalConfig & CFG_GPS_AKTIV))
246
   if(abs(FromNaviCtrl.GPS_Nick) < 512 && abs(FromNaviCtrl.GPS_Roll) < 512 && (EE_Parameter.GlobalConfig & CFG_GPS_AKTIV))
246
   {
247
   {
-
 
248
    GPS_Nick = FromNaviCtrl.GPS_Nick;
247
    GPS_Nick = FromNaviCtrl.GPS_Nick;
249
    GPS_Roll = FromNaviCtrl.GPS_Roll;
248
    GPS_Roll = FromNaviCtrl.GPS_Roll;
250
        NaviDataOkay = 250;
249
   }
251
   }
Line 250... Line 252...
250
    if(FromNaviCtrl.CompassValue <= 360)   KompassValue = FromNaviCtrl.CompassValue;
252
    if(FromNaviCtrl.CompassValue <= 360)   KompassValue = FromNaviCtrl.CompassValue;
Line 256... Line 258...
256
          {
258
          {
257
            case  SPI_KALMAN:
259
            case  SPI_KALMAN:
258
               FromNaviCtrl_Value.Kalman_K = FromNaviCtrl.Param.Byte[0];
260
               FromNaviCtrl_Value.Kalman_K = FromNaviCtrl.Param.Byte[0];
259
               FromNaviCtrl_Value.Kalman_MaxFusion = FromNaviCtrl.Param.Byte[1];
261
               FromNaviCtrl_Value.Kalman_MaxFusion = FromNaviCtrl.Param.Byte[1];
260
               FromNaviCtrl_Value.Kalman_MaxDrift = FromNaviCtrl.Param.Byte[2];
262
               FromNaviCtrl_Value.Kalman_MaxDrift = FromNaviCtrl.Param.Byte[2];
-
 
263
               FromNaviCtrl_Value.SerialDataOkay = FromNaviCtrl.Param.Byte[3];
261
               break;
264
               break;
Line 262... Line 265...
262
 
265
 
263
                default:
266
                default:
264
                  break;
267
                  break;
265
          }
268
          }
266
  }
269
  }
267
  else
270
  else
268
  {
271
  {
269
//    KompassValue = 0;
272
//    KompassValue = 0;
270
//    KompassRichtung = 0;
-
 
271
 
273
//    KompassRichtung = 0;
272
        GPS_Nick = 0;
274
        GPS_Nick = 0;
273
    GPS_Roll = 0;
275
    GPS_Roll = 0;
274
  }
276
  }