Subversion Repositories NaviCtrl

Compare Revisions

Ignore whitespace Rev 283 → Rev 284

/trunk/main.h
7,7 → 7,7
 
#define VERSION_MAJOR 0
#define VERSION_MINOR 23
#define VERSION_PATCH 6
#define VERSION_PATCH 7
// 0 = A
// 1 = B
// 2 = C
21,7 → 21,7
#define VERSION_SERIAL_MAJOR 11
#define VERSION_SERIAL_MINOR 0
 
#define FC_SPI_COMPATIBLE 17
#define FC_SPI_COMPATIBLE 18
#define MK3MAG_I2C_COMPATIBLE 3
 
// FC STATUS FLAGS
/trunk/ncmag.c
383,8 → 383,10
if(raw >= NCMAG_MIN_RAWVALUE && raw <= NCMAG_MAX_RAWVALUE) MagRawVector.Z = raw;
}
if(Compass_CalState || !NCMAG_IsCalibrated)
{ // direct output the raw data
memcpy((u8*)&MagVector,(u8*)&MagRawVector, sizeof(MagVector));
{ // mark out data invalid
MagVector.X = 0;
MagVector.Y = 0;
MagVector.Z = 0;
Compass_Heading = -1;
}
else
/trunk/spi_slave.c
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;
/trunk/spi_slave.h
34,6 → 34,7
s16 GyroNick;
s16 GyroRoll;
s16 GyroYaw;
u16 FCStatus;
union
{
u8 Byte[12];
59,7 → 60,10
u8 Command;
GPS_Stick_t GPSStick;
s16 CompassHeading;
s16 Status;
s16 MagVecX;
s16 MagVecY;
s16 MagVecZ;
s16 NCStatus;
u16 BeepTime;
union
{