/trunk/spi_slave.c |
---|
103,7 → 103,7 |
s32 ToFC_Rotate_C = 64, ToFC_Rotate_S = 0; |
s32 HeadFreeStartAngle = 0; |
s16 FC_WP_EventChannel = 0; // gibt einen Schaltkanal an die FC weiter, wenn der Wegpunkt erreicht wurde |
u32 ToFC_AltitudeSpeed = 0; |
u32 ToFC_AltitudeRate = 0; |
s32 ToFC_AltitudeSetpoint = 0; |
SPI_Version_t FC_Version; |
282,9 → 282,9 |
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.MagVecX = MagVector.X; |
ToFlightCtrl.MagVecY = MagVector.Y; |
ToFlightCtrl.MagVecZ = MagVector.Z; |
ToFlightCtrl.NCStatus = 0; |
// cycle spi commands |
ToFlightCtrl.Command = SPI_CommandSequence[SPI_CommandCounter++]; |
334,7 → 334,7 |
ToFlightCtrl.Param.Int[2] = NaviData.HomePositionDeviation.Distance; // dm //4&5 |
ToFlightCtrl.Param.sInt[3] = NaviData.HomePositionDeviation.Bearing; // deg //6&7 |
ToFlightCtrl.Param.Byte[8] = (s8)(FC_WP_EventChannel - 110); |
ToFlightCtrl.Param.Byte[9] = (u8) ToFC_AltitudeSpeed; |
ToFlightCtrl.Param.Byte[9] = (u8) ToFC_AltitudeRate; |
ToFlightCtrl.Param.sInt[5] = (s16) ToFC_AltitudeSetpoint; |
break; |
default: |
/trunk/spi_slave.h |
---|
22,7 → 22,7 |
extern s32 ToFC_Rotate_C, ToFC_Rotate_S; |
extern s32 HeadFreeStartAngle; |
extern s16 FC_WP_EventChannel; |
extern u32 ToFC_AltitudeSpeed; |
extern u32 ToFC_AltitudeRate; |
extern s32 ToFC_AltitudeSetpoint; |
typedef struct |
62,9 → 62,9 |
u8 Command; |
GPS_Stick_t GPSStick; |
s16 CompassHeading; |
// s16 MagVecX; |
// s16 MagVecY; |
// s16 MagVecZ; |
s16 MagVecX; |
s16 MagVecY; |
s16 MagVecZ; |
s16 NCStatus; |
u16 BeepTime; |
union |
/trunk/waypoints.c |
---|
98,8 → 98,9 |
PointList[i].Heading = 361; // invalid value |
PointList[i].ToleranceRadius = 0; // in meters, if the MK is within that range around the target, then the next target is triggered |
PointList[i].HoldTime = 0; // in seconds, if the was once in the tolerance area around a WP, this time defines the delay before the next WP is triggered |
PointList[i].Type = POINT_TYPE_INVALID; |
PointList[i].Event_Flag = 0; // future implementation |
PointList[i].Type = POINT_TYPE_INVALID; |
PointList[i].AltitudeRate = 0; // no change of setpoint |
} |
return TRUE; |
} |
/trunk/waypoints.h |
---|
19,9 → 19,8 |
u8 Index; // to indentify different waypoints, workaround for bad communications PC <-> NC |
u8 Type; // typeof Waypoint |
u8 WP_EventChannelValue; // |
s16 DesiredAltitude; |
u8 ClimbingSpeed; |
u8 reserve[6]; // reserve |
u8 AltitudeRate; // rate to change the setpoint |
u8 reserve[8]; // reserve |
} __attribute__((packed)) Point_t; |
extern Point_t* GPS_pPoi; // pointer to the actual point of interrest |