1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

OP-1149 Uncrustify

This commit is contained in:
Alessio Morale 2013-12-29 18:45:44 +01:00
parent ac3d7b8d11
commit e04cef2fa4
2 changed files with 81 additions and 79 deletions

View File

@ -103,15 +103,17 @@ static int8_t rotate = 0;
static bool zero_during_arming = false;
static bool bias_correct_gyro = true;
// static float gyros_passed[3];
// temp coefficient to calculate gyro bias
static bool apply_gyro_temp = false;
static bool apply_accel_temp = false;
static float gyro_temp_coeff[4] = {0};
static float accel_temp_coeff[4] = {0};
static float gyro_temp_coeff[4] = { 0 };
static float accel_temp_coeff[4] = { 0 };
// Accel and Gyro scaling (this is the product of sensor scale and adjustement in AccelGyroSettings
static float gyro_scale[3] = {0};
static float accel_scale[3] = {0};
static float gyro_scale[3] = { 0 };
static float accel_scale[3] = { 0 };
// For running trim flights
@ -424,13 +426,13 @@ static int32_t updateSensorsCC3D(AccelStateData *accelStateData, GyroStateData *
accels[1] = mpu6000_data.accel_y * accel_scale[1];
accels[2] = mpu6000_data.accel_z * accel_scale[2];
if(apply_gyro_temp) {
if (apply_gyro_temp) {
gyros[0] -= gyro_temp_coeff[0] * mpu6000_data.temperature;
gyros[1] -= gyro_temp_coeff[1] * mpu6000_data.temperature;
gyros[2] -= (gyro_temp_coeff[2] + gyro_temp_coeff[3] * mpu6000_data.temperature) * mpu6000_data.temperature;
}
if(apply_accel_temp){
if (apply_accel_temp) {
accels[0] -= accel_temp_coeff[0] * mpu6000_data.temperature;
accels[1] -= accel_temp_coeff[1] * mpu6000_data.temperature;
accels[2] -= accel_temp_coeff[2] * mpu6000_data.temperature;
@ -641,28 +643,28 @@ static void settingsUpdatedCb(__attribute__((unused)) UAVObjEvent *objEv)
accel_temp_coeff[1] = accelGyroSettings.accel_temp_coeff.Y;
accel_temp_coeff[2] = accelGyroSettings.accel_temp_coeff.Z;
apply_gyro_temp = ( fabsf(gyro_temp_coeff[0])> 1e-6f ||
fabsf(gyro_temp_coeff[1])> 1e-6f ||
fabsf(gyro_temp_coeff[2])> 1e-6f ||
fabsf(gyro_temp_coeff[3])> 1e-6f);
apply_gyro_temp = (fabsf(gyro_temp_coeff[0]) > 1e-6f ||
fabsf(gyro_temp_coeff[1]) > 1e-6f ||
fabsf(gyro_temp_coeff[2]) > 1e-6f ||
fabsf(gyro_temp_coeff[3]) > 1e-6f);
apply_accel_temp = (fabsf(accel_temp_coeff[0])> 1e-6f ||
fabsf(accel_temp_coeff[1])> 1e-6f ||
fabsf(accel_temp_coeff[2])> 1e-6f);
apply_accel_temp = (fabsf(accel_temp_coeff[0]) > 1e-6f ||
fabsf(accel_temp_coeff[1]) > 1e-6f ||
fabsf(accel_temp_coeff[2]) > 1e-6f);
gyro_correct_int[0] = accelGyroSettings.gyro_bias.X;
gyro_correct_int[1] = accelGyroSettings.gyro_bias.Y;
gyro_correct_int[2] = accelGyroSettings.gyro_bias.Z;
if(BOARDISCC3D) {
if (BOARDISCC3D) {
accelbias[0] = accelGyroSettings.accel_bias.X;
accelbias[1] = accelGyroSettings.accel_bias.Y;
accelbias[2] = accelGyroSettings.accel_bias.Z;
gyro_scale[0] = accelGyroSettings.gyro_scale.X * PIOS_MPU6000_GetScale ();
gyro_scale[1] = accelGyroSettings.gyro_scale.Y * PIOS_MPU6000_GetScale ();
gyro_scale[2] = accelGyroSettings.gyro_scale.Z * PIOS_MPU6000_GetScale ();
gyro_scale[0] = accelGyroSettings.gyro_scale.X * PIOS_MPU6000_GetScale();
gyro_scale[1] = accelGyroSettings.gyro_scale.Y * PIOS_MPU6000_GetScale();
gyro_scale[2] = accelGyroSettings.gyro_scale.Z * PIOS_MPU6000_GetScale();
accel_scale[0] = accelGyroSettings.accel_scale.X * PIOS_MPU6000_GetAccelScale();
accel_scale[1] = accelGyroSettings.accel_scale.Y * PIOS_MPU6000_GetAccelScale();

View File

@ -90,8 +90,8 @@ static float accel_scale[3] = { 0, 0, 0 };
static float gyro_staticbias[3] = { 0, 0, 0 };
static float gyro_scale[3] = { 0, 0, 0 };
// temp coefficient to calculate gyro bias
static float gyro_temp_coeff[4] = {0};
static float accel_temp_coeff[4] = {0};
static float gyro_temp_coeff[4] = { 0 };
static float accel_temp_coeff[4] = { 0 };
static float R[3][3] = {
{ 0 }
@ -358,7 +358,7 @@ static void SensorsTask(__attribute__((unused)) void *parameters)
- accel_temp_coeff[1] * accelSensorData.temperature,
accels[2] * accel_scaling * accel_scale[2]
- accel_bias[2]
- accel_temp_coeff[2] * accelSensorData.temperature};
- accel_temp_coeff[2] * accelSensorData.temperature };
if (rotate) {
rot_mult(R, accels_out, accels);
accelSensorData.x = accels[0];
@ -384,7 +384,7 @@ static void SensorsTask(__attribute__((unused)) void *parameters)
gyros[2] * gyro_scaling * gyro_scale[2]
- gyro_staticbias[2]
- gyro_temp_coeff[2] * gyroSensorData.temperature
- gyro_temp_coeff[3] * gyroSensorData.temperature * gyroSensorData.temperature};
- gyro_temp_coeff[3] * gyroSensorData.temperature * gyroSensorData.temperature };
if (rotate) {
rot_mult(R, gyros_out, gyros);
gyroSensorData.x = gyros[0];