66,7 → 66,7 |
#include "timer2.h" |
#include "config.h" |
#include "main.h" |
#include "compass.h" |
#include "compass.h" |
|
|
#define SPI_RXSYNCBYTE1 0xAA |
280,6 → 280,10 |
ToFlightCtrl.CompassHeading = Compass_Heading; |
DebugOut.Analog[10] = ToFlightCtrl.CompassHeading; |
if(ToFlightCtrl.CompassHeading >= 0) ToFlightCtrl.CompassHeading = (360 + ToFlightCtrl.CompassHeading + FromFlightCtrl.GyroYaw / 12) % 360; |
ToFlightCtrl.MagVecX = MagVector.X; |
ToFlightCtrl.MagVecY = MagVector.Y; |
ToFlightCtrl.MagVecZ = MagVector.Z; |
ToFlightCtrl.NCStatus = 0; |
// cycle spi commands |
ToFlightCtrl.Command = SPI_CommandSequence[SPI_CommandCounter++]; |
// restart command cycle at the end |
351,7 → 355,7 |
ClearFCStatusFlags = 0; |
} |
FC.StatusFlags |= FromFlightCtrl.Param.Byte[8]; |
if(FC.StatusFlags&FC_STATUS_CALIBRATE && !FCCalibActive) |
if(FC.StatusFlags&FC_STATUS_CALIBRATE && !FCCalibActive) |
{ |
Compass_Init(); |
FCCalibActive = 1; |
358,7 → 362,7 |
} |
else |
{ |
FCCalibActive = 0; |
FCCalibActive = 0; |
} |
Parameter.ActiveSetting = FromFlightCtrl.Param.Byte[9]; |
DebugOut.Analog[5] = FC.StatusFlags; |