mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-06 21:54:15 +01:00
OP-1058 uncrustify
This commit is contained in:
parent
f226b23c24
commit
01d963affd
@ -692,11 +692,11 @@ static void updateStabilizationDesired(ManualControlCommandData *cmd, ManualCont
|
||||
|
||||
stabilization.Roll =
|
||||
(stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_NONE) ? cmd->Roll :
|
||||
(stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_RATE) ? cmd->Roll * stabSettings.ManualRate.fields.Roll:
|
||||
(stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_RATE) ? cmd->Roll * stabSettings.ManualRate.fields.Roll :
|
||||
(stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_WEAKLEVELING) ?
|
||||
cmd->Roll * stabSettings.ManualRate.fields.Roll :
|
||||
(stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE) ? cmd->Roll * stabSettings.RollMax :
|
||||
(stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_AXISLOCK) ? cmd->Roll * stabSettings.ManualRate.fields.Roll:
|
||||
(stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_AXISLOCK) ? cmd->Roll * stabSettings.ManualRate.fields.Roll :
|
||||
(stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_VIRTUALBAR) ? cmd->Roll :
|
||||
(stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_RELAYRATE) ?
|
||||
cmd->Roll * stabSettings.ManualRate.fields.Roll :
|
||||
|
@ -446,14 +446,14 @@ static void settingsUpdatedCb(__attribute__((unused)) UAVObjEvent *objEv)
|
||||
AttitudeSettingsGet(&attitudeSettings);
|
||||
|
||||
// Indicates not to expend cycles on rotation
|
||||
if (attitudeSettings.BoardRotation.fields.Roll== 0 && attitudeSettings.BoardRotation.fields.Pitch == 0 &&
|
||||
if (attitudeSettings.BoardRotation.fields.Roll == 0 && attitudeSettings.BoardRotation.fields.Pitch == 0 &&
|
||||
attitudeSettings.BoardRotation.fields.Yaw == 0) {
|
||||
rotate = 0;
|
||||
} else {
|
||||
float rotationQuat[4];
|
||||
const float rpy[3] = { attitudeSettings.BoardRotation.fields.Roll,
|
||||
attitudeSettings.BoardRotation.fields.Pitch ,
|
||||
attitudeSettings.BoardRotation.fields.Yaw};
|
||||
attitudeSettings.BoardRotation.fields.Pitch,
|
||||
attitudeSettings.BoardRotation.fields.Yaw };
|
||||
RPY2Quaternion(rpy, rotationQuat);
|
||||
Quaternion2R(rotationQuat, R);
|
||||
rotate = 1;
|
||||
|
@ -503,7 +503,7 @@ static void SettingsUpdatedCb(__attribute__((unused)) UAVObjEvent *ev)
|
||||
lowThrottleZeroIntegral = settings.LowThrottleZeroIntegral == STABILIZATIONSETTINGS_LOWTHROTTLEZEROINTEGRAL_TRUE;
|
||||
|
||||
// Whether to suppress (zero) the StabilizationDesired output for each axis while disarmed or throttle is low
|
||||
lowThrottleZeroAxis[ROLL] = settings.LowThrottleZeroAxis.fields.Roll== STABILIZATIONSETTINGS_LOWTHROTTLEZEROAXIS_TRUE;
|
||||
lowThrottleZeroAxis[ROLL] = settings.LowThrottleZeroAxis.fields.Roll == STABILIZATIONSETTINGS_LOWTHROTTLEZEROAXIS_TRUE;
|
||||
lowThrottleZeroAxis[PITCH] = settings.LowThrottleZeroAxis.fields.Pitch == STABILIZATIONSETTINGS_LOWTHROTTLEZEROAXIS_TRUE;
|
||||
lowThrottleZeroAxis[YAW] = settings.LowThrottleZeroAxis.fields.Yaw == STABILIZATIONSETTINGS_LOWTHROTTLEZEROAXIS_TRUE;
|
||||
|
||||
|
@ -125,12 +125,12 @@ bool UAVObjectGeneratorFlight::process_object(ObjectInfo *info)
|
||||
// Append field
|
||||
// Check if it a named set and creates structures accordingly
|
||||
if (info->fields[n]->numElements > 1) {
|
||||
if(info->fields[n]->elementNames[0].compare(QString("0")) != 0){
|
||||
if (info->fields[n]->elementNames[0].compare(QString("0")) != 0) {
|
||||
QString unionTypeName = QString("%1%2Data").arg(info->name).arg(info->fields[n]->name);
|
||||
QString unionType = QString("typedef union {\n");
|
||||
unionType.append(QString(" %1 data[%2];\n").arg(type).arg(info->fields[n]->numElements));
|
||||
unionType.append(QString(" struct __attribute__ ((__packed__)) {\n"));
|
||||
for(int f =0; f < info->fields[n]->elementNames.count(); f++){
|
||||
for (int f = 0; f < info->fields[n]->elementNames.count(); f++) {
|
||||
unionType.append(QString(" %1 %2;\n").arg(type).arg(info->fields[n]->elementNames[f]));
|
||||
}
|
||||
unionType.append(QString(" } fields;\n"));
|
||||
@ -140,7 +140,6 @@ bool UAVObjectGeneratorFlight::process_object(ObjectInfo *info)
|
||||
|
||||
fields.append(QString(" %1 %2;\n").arg(unionTypeName)
|
||||
.arg(info->fields[n]->name));
|
||||
|
||||
} else {
|
||||
fields.append(QString(" %1 %2[%3];\n").arg(type)
|
||||
.arg(info->fields[n]->name).arg(info->fields[n]->numElements));
|
||||
@ -227,7 +226,7 @@ bool UAVObjectGeneratorFlight::process_object(ObjectInfo *info)
|
||||
// Initialize all fields in the array
|
||||
for (int idx = 0; idx < info->fields[n]->numElements; ++idx) {
|
||||
QString optIdentifier;
|
||||
if(info->fields[n]->elementNames[0].compare(QString("0")) != 0){
|
||||
if (info->fields[n]->elementNames[0].compare(QString("0")) != 0) {
|
||||
optIdentifier = QString(".data");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user