Subversion Repositories MK3Mag

Rev

Rev 29 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 29 Rev 30
Line 70... Line 70...
70
AttitudeSource_t AttitudeSource = ATTITUDE_SOURCE_ACC;
70
AttitudeSource_t AttitudeSource = ATTITUDE_SOURCE_ACC;
71
Orientation_t Orientation = ORIENTATION_FC;
71
Orientation_t Orientation = ORIENTATION_FC;
Line 72... Line 72...
72
 
72
 
Line 73... Line 73...
73
uint16_t Led_Timer = 0;
73
uint16_t Led_Timer = 0;
74
 
74
 
75
struct Scaling_t
75
typedef struct
76
{
76
{
77
        int16_t Range;
77
        int16_t Range;
Line 78... Line 78...
78
        int16_t Offset;
78
        int16_t Offset;
79
} ;
79
}  Scaling_t;
80
 
80
 
81
struct Calibration_t
81
typedef struct
82
{
82
{
83
        struct Scaling_t MagX;
83
        Scaling_t MagX;
84
        struct Scaling_t MagY;
84
        Scaling_t MagY;
85
        struct Scaling_t MagZ;
85
        Scaling_t MagZ;
86
        struct Scaling_t AccX;
86
        Scaling_t AccX;
Line 87... Line 87...
87
        struct Scaling_t AccY;
87
        Scaling_t AccY;
88
        struct Scaling_t AccZ;
88
        Scaling_t AccZ;
Line 89... Line 89...
89
};
89
}  Calibration_t;
90
 
90
 
91
struct Calibration_t eeCalibration EEMEM;       // calibration data in EEProm
91
Calibration_t eeCalibration EEMEM;      // calibration data in EEProm
92
struct Calibration_t Calibration;               // calibration data in RAM
92
Calibration_t Calibration;              // calibration data in RAM
Line 453... Line 453...
453
        USART0_ProcessRxData();
453
        USART0_ProcessRxData();
Line 454... Line 454...
454
 
454
 
455
                if(NC_Connected) NC_Connected--;
455
                if(NC_Connected) NC_Connected--;
456
                if(FC_Connected) FC_Connected--;
456
                if(FC_Connected) FC_Connected--;
457
                // fall back to attitude estimation from acc sensor if NC or FC does'nt send attittude data
457
                // fall back to attitude estimation from acc sensor if NC or FC does'nt send attittude data
458
                if(!NC_Connected && ! NC_Connected)
458
                if(!FC_Connected && ! NC_Connected)
459
                {
459
                {
460
                        AttitudeSource = ATTITUDE_SOURCE_ACC;
460
                        AttitudeSource = ATTITUDE_SOURCE_ACC;
461
                        Orientation = ORIENTATION_FC;
461
                        Orientation = ORIENTATION_FC;