Subversion Repositories MK3Mag

Compare Revisions

Ignore whitespace Rev 29 → Rev 30

/branches/MK3Mag V0.14 Code Redesign Killagreg/main.c
72,24 → 72,24
uint16_t Led_Timer = 0;
struct Scaling_t
typedef struct
int16_t Range;
int16_t Offset;
} ;
} Scaling_t;
struct Calibration_t
typedef struct
struct Scaling_t MagX;
struct Scaling_t MagY;
struct Scaling_t MagZ;
struct Scaling_t AccX;
struct Scaling_t AccY;
struct Scaling_t AccZ;
Scaling_t MagX;
Scaling_t MagY;
Scaling_t MagZ;
Scaling_t AccX;
Scaling_t AccY;
Scaling_t AccZ;
} Calibration_t;
struct Calibration_t eeCalibration EEMEM; // calibration data in EEProm
struct Calibration_t Calibration; // calibration data in RAM
Calibration_t eeCalibration EEMEM; // calibration data in EEProm
Calibration_t Calibration; // calibration data in RAM
// magnet sensor variable
int16_t RawMagnet1a, RawMagnet1b; // raw magnet sensor data
455,7 → 455,7
if(NC_Connected) NC_Connected--;
if(FC_Connected) FC_Connected--;
// fall back to attitude estimation from acc sensor if NC or FC does'nt send attittude data
if(!NC_Connected && ! NC_Connected)
if(!FC_Connected && ! NC_Connected)
Orientation = ORIENTATION_FC;
/branches/MK3Mag V0.14 Code Redesign Killagreg/twislave.c
71,11 → 71,11
volatile uint8_t I2C_PrimRxBuffer[10];
uint8_t NC_Connected = 0;
struct I2C_Heading_t I2C_Heading;
struct I2C_WriteAttitude_t I2C_WriteAttitude;
struct I2C_Mag_t I2C_Mag;
struct I2C_Version_t I2C_Version;
struct I2C_WriteCal_t I2C_WriteCal;
I2C_Heading_t I2C_Heading;
I2C_WriteAttitude_t I2C_WriteAttitude;
I2C_Mag_t I2C_Mag;
I2C_Version_t I2C_Version;
I2C_WriteCal_t I2C_WriteCal;
void I2C_Init(void)
/branches/MK3Mag V0.14 Code Redesign Killagreg/twislave.h
14,46 → 14,46
#define I2C_CMD_READ_EEPROM 0x0B
struct I2C_Version_t
typedef struct
uint8_t Major;
uint8_t Minor;
uint8_t Compatible;
} ;
} I2C_Version_t;
struct I2C_Mag_t
typedef struct
int16_t MagX;
int16_t MagY;
int16_t MagZ;
} ;
} I2C_Mag_t;
struct I2C_WriteAttitude_t
typedef struct
int16_t Nick;
int16_t Roll;
} ;
} I2C_WriteAttitude_t;
struct I2C_WriteCal_t
typedef struct
uint8_t CalByte;
uint8_t Dummy1;
uint8_t Dummy2;
} ;
} I2C_WriteCal_t;
struct I2C_Heading_t
typedef struct
int16_t Heading;
} ;
} I2C_Heading_t;
extern uint8_t NC_Connected;
extern struct I2C_Heading_t I2C_Heading;
extern struct I2C_WriteAttitude_t I2C_WriteAttitude;
extern struct I2C_Mag_t I2C_Mag;
extern struct I2C_Version_t I2C_Version;
extern struct I2C_WriteCal_t I2C_WriteCal;
extern I2C_Heading_t I2C_Heading;
extern I2C_WriteAttitude_t I2C_WriteAttitude;
extern I2C_Mag_t I2C_Mag;
extern I2C_Version_t I2C_Version;
extern I2C_WriteCal_t I2C_WriteCal;
void I2C_Init(void);
/branches/MK3Mag V0.14 Code Redesign Killagreg/uart.c
90,10 → 90,10
uint8_t MySlaveAddr = 0;
struct DebugOut_t DebugOut;
struct ExternData_t ExternData;
struct ExternControl_t ExternControl;
struct VersionInfo_t VersionInfo;
DebugOut_t DebugOut;
ExternData_t ExternData;
ExternControl_t ExternControl;
VersionInfo_t VersionInfo;
uint16_t Debug_Timer;
/branches/MK3Mag V0.14 Code Redesign Killagreg/uart.h
23,28 → 23,28
struct DebugOut_t
typedef struct
uint8_t Digital[2];
uint16_t Analog[32]; // Debugvalues
} ;
} DebugOut_t;
extern struct DebugOut_t DebugOut;
extern DebugOut_t DebugOut;
struct ExternData_t
typedef struct
int16_t Attitude[2]; // nick and roll angle in 0.1 deg
uint8_t UserParam[2];
uint8_t CalState;
uint8_t Orientation;
} ;
} ExternData_t;
extern struct ExternData_t ExternData;
extern ExternData_t ExternData;
struct ExternControl_t
typedef struct
uint8_t Digital[2];
uint8_t RemoteButtons;
56,12 → 56,12
uint8_t Par1;
uint8_t Par2;
uint8_t Par3;
} ;
} ExternControl_t;
extern struct ExternControl_t ExternControl;
extern ExternControl_t ExternControl;
struct VersionInfo_t
typedef struct
uint8_t Major;
uint8_t Minor;
69,7 → 69,7
uint8_t Reserved[7];
} VersionInfo_t;
extern struct VersionInfo_t VersionInfo;
extern VersionInfo_t VersionInfo;
extern uint8_t PC_Connected;
extern uint8_t FC_Connected;