Subversion Repositories FlightCtrl

Rev

Rev 2025 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2025 Rev 2099
Line 1... Line 1...
1
#include "ADXRS610_FC2.0.h"
1
#include "ADXRS610_FC2.0.h"
2
#include "configuration.h"
2
#include "configuration.h"
Line 3... Line -...
3
 
-
 
4
const uint8_t GYRO_QUADRANT = 3;
-
 
5
//const uint8_t ACC_QUADRANT = 0;
-
 
6
 
-
 
7
const uint8_t YAW_GYRO_REVERSED = 0;
-
 
8
const uint8_t PR_GYROS_ORIENTATION_REVERSED = 0;
-
 
9
 
-
 
10
const uint8_t Z_ACC_REVERSED = 0;
-
 
11
 
3
 
-
 
4
void gyro_calibrate(void) {
12
void gyro_calibrate(void) {
5
  // Nothing to calibrate.
Line 13... Line 6...
13
}
6
}
14
 
7
 
15
void gyro_setDefaults(void) {
-
 
16
        staticParams.DriftComp = 0;
-
 
17
        staticParams.GyroAccFactor = 1;
8
void gyro_init(void) {
Line 18... Line -...
18
        staticParams.GyroAccTrim = 1;
-
 
19
}
-
 
20
 
-
 
21
/*
-
 
22
 
-
 
23
normal  1rev  2rev
-
 
24
0
-
 
25
1 0    -1 0    1  0
-
 
26
0 1     0 1    0 -1
-
 
27
 
-
 
28
45
-
 
29
1 -1   -1 -1   1  1
-
 
30
1  1   -1  1   1 -1
-
 
31
 
-
 
32
90
-
 
33
0 -1    0 -1   0  1
-
 
34
1  0   -1  0   1  0
-
 
35
 
-
 
36
135
-
 
37
-1 -1   1 -1  -1  1
-
 
38
1  -1  -1 -1   1  1
-
 
39
 
-
 
40
180
-
 
41
-1 0    1  0   -1 0
-
 
42
0 -1    0 -1   0  1
-
 
43
 
-
 
44
225
-
 
45
-1 1    1  1   -1 -1
-
 
46
-1 -1   1 -1   -1  1
-
 
47
 
-
 
48
270
-
 
49
0  1    0  1   0 -1
-
 
50
-1 0    1  0   -1 0
-
 
51
 
-
 
52
315
-
 
53
 1 1   -1  1   1 -1
-
 
54
-1 1    1  1  -1 -1
9
  // No amplifiers, no DAC.
55
 
10
}
56
 
11
 
57
0,0: 1,1,0,-1,-1,-1,0,1 paddp = tab[n]
12
void gyro_setDefaultParameters(void) {
58
0,1: 0,-1,-1,-1,0,1,1,1 paddr = tab[n+2]
-
 
59
1,0: 0,1,1,1,0,-1,-1,-1 raddp = tab[n+6]
-
 
60
1,1: 1,1,0,-1,-1,-1,0,1 raddr = tab[n]
13
  IMUConfig.accQuadrant = 4;
61
 
-
 
62
reverse:
14
  IMUConfig.imuReversedFlags = IMU_REVERSE_ACC_XY;
63
0,0: -1,-1,0,1,1,1,0,-1 paddp = tab[n+4]
15
  staticParams.gyroD = 5;
64
0,1: 0,-1,-1,-1,0,1,1,1 (same)= tab[n+2]
16
  IMUConfig.driftCompDivider = 1;
65
1,0: 0,-1,-1,-1,0,1,1,1 raddp = tab[n+2]
-
 
66
1,1: 1,1,0,-1,-1,-1,0,1 (same)= tab[n]
-