Subversion Repositories FlightCtrl

Rev

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

Rev 1646 Rev 1775
Line 3... Line 3...
3
 
3
 
4
#include <inttypes.h>
4
#include <inttypes.h>
Line 5... Line 5...
5
#include <avr/io.h>
5
#include <avr/io.h>
6
 
6
 
7
typedef struct {
7
typedef struct {
8
        uint8_t HeightD;
8
  /*PMM*/ uint8_t HeightD;
9
        uint8_t MaxHeight;
9
  /* P */ uint8_t MaxHeight;
10
        uint8_t HeightP;
10
  /*PMM*/ uint8_t HeightP;
11
        uint8_t Height_ACC_Effect;
11
  /* P */ uint8_t Height_ACC_Effect;
12
        uint8_t CompassYawEffect;
12
  /* P */ uint8_t CompassYawEffect;
13
        uint8_t GyroD;
13
  /* P */ uint8_t GyroD;
14
        uint8_t GyroP;
14
  /*PMM*/ uint8_t GyroP;
15
        uint8_t GyroI;
15
  /* P */ uint8_t GyroI;
16
        uint8_t StickYawP;
16
  /* Never used */ uint8_t StickYawP;
17
        uint8_t IFactor;
-
 
18
        uint8_t UserParams[8];
-
 
19
  /*
-
 
20
        uint8_t UserParam2;
-
 
21
        uint8_t UserParam3;
-
 
22
        uint8_t UserParam4;
-
 
23
        uint8_t UserParam5;
-
 
24
        uint8_t UserParam6;
-
 
25
        uint8_t UserParam7;
-
 
26
        uint8_t UserParam8;
17
  /* P */ uint8_t IFactor;
27
  */
18
  /* P */ uint8_t UserParams[8];
28
        uint8_t ServoPitchControl;
19
  /* P */ uint8_t ServoPitchControl;
29
        uint8_t LoopGasLimit;
20
  /* P */ uint8_t LoopGasLimit;
30
        uint8_t AxisCoupling1;
21
  /* P */ uint8_t AxisCoupling1;
31
        uint8_t AxisCoupling2;
22
  /* P */ uint8_t AxisCoupling2;
32
        uint8_t AxisCouplingYawCorrection;
23
  /* P */ uint8_t AxisCouplingYawCorrection;
33
        uint8_t DynamicStability;
24
  /* P */ uint8_t DynamicStability;
34
        uint8_t ExternalControl;
25
  /* P */ uint8_t ExternalControl;
35
        uint8_t J16Timing;
-
 
36
        uint8_t J17Timing;
26
  /*PMM*/ uint8_t J16Timing;
37
        #if (defined (USE_KILLAGREG) || defined (USE_MK3MAG))
27
  /*PMM*/ uint8_t J17Timing;
38
        uint8_t NaviGpsModeControl;
28
  /* P */ uint8_t NaviGpsModeControl;
39
        uint8_t NaviGpsGain;
29
  /* P */ uint8_t NaviGpsGain;
40
        uint8_t NaviGpsP;
30
  /* P */ uint8_t NaviGpsP;
41
        uint8_t NaviGpsI;
31
  /* P */ uint8_t NaviGpsI;
42
        uint8_t NaviGpsD;
32
  /* P */ uint8_t NaviGpsD;
43
        uint8_t NaviGpsACC;
33
  /* P */ uint8_t NaviGpsACC;
44
        uint8_t NaviOperatingRadius;
34
  /*PMM*/ uint8_t NaviOperatingRadius;
45
        uint8_t NaviWindCorrection;
-
 
46
        uint8_t NaviSpeedCompensation;
35
  /* P */ uint8_t NaviWindCorrection;
47
        #endif
36
  /* P */ uint8_t NaviSpeedCompensation;
48
        int8_t KalmanK;
37
  int8_t KalmanK;
49
        int8_t KalmanMaxDrift;
38
  int8_t KalmanMaxDrift;
-
 
39
  int8_t KalmanMaxFusion;
Line -... Line 40...
-
 
40
} dynamicParam_t;
-
 
41
extern dynamicParam_t dynamicParams;
-
 
42
 
-
 
43
typedef struct {
-
 
44
  uint8_t sourceIdx, targetIdx;
-
 
45
  uint8_t min, max;
50
        int8_t KalmanMaxFusion;
46
} MMXLATION;
-
 
47
 
Line 51... Line 48...
51
} fc_param_t;
48
typedef struct {
52
 
49
  uint8_t sourceIdx, targetIdx;
53
extern fc_param_t dynamicParams;
50
} XLATION;
54
 
51
 
Line 162... Line 159...
162
#define CFG_COMPASS_FIX         (1<<4)
159
#define CFG_COMPASS_FIX         (1<<4)
163
#define CFG_GPS_ACTIVE          (1<<5)
160
#define CFG_GPS_ACTIVE          (1<<5)
164
#define CFG_AXIS_COUPLING_ACTIVE (1<<6)
161
#define CFG_AXIS_COUPLING_ACTIVE (1<<6)
165
#define CFG_ROTARY_RATE_LIMITER (1<<7)
162
#define CFG_ROTARY_RATE_LIMITER (1<<7)
Line 166... Line 163...
166
 
163
 
167
// bit mask for ParamSet.BitConfig
164
// bit mask for staticParams.BitConfig
168
#define CFG_LOOP_UP             (1<<0)
165
#define CFG_LOOP_UP             (1<<0)
169
#define CFG_LOOP_DOWN           (1<<1)
166
#define CFG_LOOP_DOWN           (1<<1)
170
#define CFG_LOOP_LEFT           (1<<2)
167
#define CFG_LOOP_LEFT           (1<<2)
171
#define CFG_LOOP_RIGHT          (1<<3)
168
#define CFG_LOOP_RIGHT          (1<<3)