1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 08:45:36 +03:00

Convert gyroADC and accADC to int32_t

This commit is contained in:
borisbstyle 2016-02-14 20:17:11 +01:00
parent 468cebcec2
commit 881a448255
8 changed files with 30 additions and 22 deletions

View file

@ -37,8 +37,9 @@
#include "sensors/gyro.h"
uint16_t calibratingG = 0;
int16_t gyroADC[XYZ_AXIS_COUNT];
int16_t gyroZero[FLIGHT_DYNAMICS_INDEX_COUNT] = { 0, 0, 0 };
int16_t gyroADCRaw[XYZ_AXIS_COUNT];
int32_t gyroADC[XYZ_AXIS_COUNT];
int32_t gyroZero[FLIGHT_DYNAMICS_INDEX_COUNT] = { 0, 0, 0 };
static gyroConfig_t *gyroConfig;
static biquad_t gyroFilterState[3];
@ -133,10 +134,12 @@ static void applyGyroZero(void)
void gyroUpdate(void)
{
// range: +/- 8192; +/- 2000 deg/sec
if (!gyro.read(gyroADC)) {
if (!gyro.read(gyroADCRaw)) {
return;
}
for (axis = 0; axis < XYZ_AXIS_COUNT; axis++) gyroADC[axis] = gyroADCRaw[axis];
alignSensors(gyroADC, gyroADC, gyroAlign);
if (gyroLpfCutFreq) {