1,69 → 1,19 |
#include "ADXRS610_FC2.0.h" |
#include "configuration.h" |
|
const uint8_t GYRO_QUADRANT = 3; |
//const uint8_t ACC_QUADRANT = 0; |
|
const uint8_t YAW_GYRO_REVERSED = 0; |
const uint8_t PR_GYROS_ORIENTATION_REVERSED = 0; |
|
const uint8_t Z_ACC_REVERSED = 0; |
|
void gyro_calibrate(void) { |
// Nothing to calibrate. |
} |
|
void gyro_setDefaults(void) { |
staticParams.DriftComp = 0; |
staticParams.GyroAccFactor = 1; |
staticParams.GyroAccTrim = 1; |
void gyro_init(void) { |
// No amplifiers, no DAC. |
} |
|
/* |
|
normal 1rev 2rev |
|
1 0 -1 0 1 0 |
0 1 0 1 0 -1 |
|
45 |
1 -1 -1 -1 1 1 |
1 1 -1 1 1 -1 |
|
90 |
0 -1 0 -1 0 1 |
1 0 -1 0 1 0 |
|
135 |
-1 -1 1 -1 -1 1 |
1 -1 -1 -1 1 1 |
|
180 |
-1 0 1 0 -1 0 |
0 -1 0 -1 0 1 |
|
225 |
-1 1 1 1 -1 -1 |
-1 -1 1 -1 -1 1 |
|
270 |
0 1 0 1 0 -1 |
-1 0 1 0 -1 0 |
|
315 |
1 1 -1 1 1 -1 |
-1 1 1 1 -1 -1 |
|
|
0,0: 1,1,0,-1,-1,-1,0,1 paddp = tab[n] |
0,1: 0,-1,-1,-1,0,1,1,1 paddr = tab[n+2] |
1,0: 0,1,1,1,0,-1,-1,-1 raddp = tab[n+6] |
1,1: 1,1,0,-1,-1,-1,0,1 raddr = tab[n] |
|
reverse: |
0,0: -1,-1,0,1,1,1,0,-1 paddp = tab[n+4] |
0,1: 0,-1,-1,-1,0,1,1,1 (same)= tab[n+2] |
1,0: 0,-1,-1,-1,0,1,1,1 raddp = tab[n+2] |
1,1: 1,1,0,-1,-1,-1,0,1 (same)= tab[n] |
|
= 1rev[n-4] = 1rev[n+4] |
*/ |
void gyro_setDefaultParameters(void) { |
IMUConfig.accQuadrant = 4; |
IMUConfig.imuReversedFlags = IMU_REVERSE_ACC_XY; |
staticParams.gyroD = 5; |
IMUConfig.driftCompDivider = 1; |
IMUConfig.driftCompLimit = 3; |
IMUConfig.zerothOrderCorrection = 1; |
} |