79,7 → 79,7 |
volatile int16_t rawGyroSum[3]; |
volatile int16_t acc[3]; |
volatile int16_t filteredAcc[2] = { 0,0 }; |
volatile int32_t stronglyFilteredAcc[3] = { 0,0,0 }; |
// volatile int32_t stronglyFilteredAcc[3] = { 0,0,0 }; |
|
/* |
* These 4 exported variables are zero-offset. The "PID" ones are used |
254,8 → 254,6 |
uint8_t i, axis; |
int16_t newrange; |
|
J5HIGH; |
|
// for various filters... |
int16_t tempOffsetGyro, tempGyro; |
|
273,8 → 271,10 |
else |
acc[Z] = sensorInputs[AD_ACC_Z] - accOffset[Z]; |
|
/* |
stronglyFilteredAcc[Z] = |
(stronglyFilteredAcc[Z] * 99 + acc[Z] * 10) / 100; |
*/ |
|
break; |
|
295,10 → 295,11 |
filteredAcc[PITCH] = |
(filteredAcc[PITCH] * (ACC_FILTER - 1) + acc[PITCH]) / ACC_FILTER; |
|
/* |
stronglyFilteredAcc[PITCH] = |
(stronglyFilteredAcc[PITCH] * 99 + acc[PITCH] * 10) / 100; |
*/ |
|
|
measureNoise(acc[PITCH], &accNoisePeak[PITCH], 1); |
break; |
|
310,8 → 311,10 |
filteredAcc[ROLL] = |
(filteredAcc[ROLL] * (ACC_FILTER - 1) + acc[ROLL]) / ACC_FILTER; |
|
/* |
stronglyFilteredAcc[ROLL] = |
(stronglyFilteredAcc[ROLL] * 99 + acc[ROLL] * 10) / 100; |
*/ |
|
measureNoise(acc[ROLL], &accNoisePeak[ROLL], 1); |
break; |
482,10 → 485,6 |
// after full cycle stop further interrupts |
if (state) |
analog_start(); |
else |
J4LOW; |
|
J5LOW; |
} |
|
void analog_calibrate(void) { |