Subversion Repositories NaviCtrl

Rev

Rev 280 | Rev 285 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 280 Rev 284
Line 278... Line 278...
278
                // avoid sending data via SPI during the update of the  ToFlightCtrl structure
278
                // avoid sending data via SPI during the update of the  ToFlightCtrl structure
279
                VIC_ITCmd(SSP0_ITLine, DISABLE); // disable SPI interrupt
279
                VIC_ITCmd(SSP0_ITLine, DISABLE); // disable SPI interrupt
280
                ToFlightCtrl.CompassHeading = Compass_Heading;
280
                ToFlightCtrl.CompassHeading = Compass_Heading;
281
                DebugOut.Analog[10] = ToFlightCtrl.CompassHeading;
281
                DebugOut.Analog[10] = ToFlightCtrl.CompassHeading;
282
                if(ToFlightCtrl.CompassHeading >= 0) ToFlightCtrl.CompassHeading = (360 + ToFlightCtrl.CompassHeading + FromFlightCtrl.GyroYaw / 12) % 360;
282
                if(ToFlightCtrl.CompassHeading >= 0) ToFlightCtrl.CompassHeading = (360 + ToFlightCtrl.CompassHeading + FromFlightCtrl.GyroYaw / 12) % 360;
-
 
283
                ToFlightCtrl.MagVecX = MagVector.X;
-
 
284
                ToFlightCtrl.MagVecY = MagVector.Y;
-
 
285
                ToFlightCtrl.MagVecZ = MagVector.Z;
-
 
286
                ToFlightCtrl.NCStatus = 0;
283
                // cycle spi commands
287
                // cycle spi commands
284
                ToFlightCtrl.Command = SPI_CommandSequence[SPI_CommandCounter++];
288
                ToFlightCtrl.Command = SPI_CommandSequence[SPI_CommandCounter++];
285
                // restart command cycle at the end
289
                // restart command cycle at the end
286
                if (SPI_CommandCounter >= sizeof(SPI_CommandSequence)) SPI_CommandCounter = 0;
290
                if (SPI_CommandCounter >= sizeof(SPI_CommandSequence)) SPI_CommandCounter = 0;