mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
uncrustified
This commit is contained in:
parent
b4b93bee93
commit
9a312ef115
@ -237,22 +237,22 @@ static bool check_stabilization_settings(int index, bool multirotor, bool copter
|
||||
// Get the different axis modes for this switch position
|
||||
switch (index) {
|
||||
case 1:
|
||||
FlightModeSettingsStabilization1SettingsArrayGet((FlightModeSettingsStabilization1SettingsOptions*) modes);
|
||||
FlightModeSettingsStabilization1SettingsArrayGet((FlightModeSettingsStabilization1SettingsOptions *)modes);
|
||||
break;
|
||||
case 2:
|
||||
FlightModeSettingsStabilization2SettingsArrayGet((FlightModeSettingsStabilization2SettingsOptions*) modes);
|
||||
FlightModeSettingsStabilization2SettingsArrayGet((FlightModeSettingsStabilization2SettingsOptions *)modes);
|
||||
break;
|
||||
case 3:
|
||||
FlightModeSettingsStabilization3SettingsArrayGet((FlightModeSettingsStabilization3SettingsOptions*) modes);
|
||||
FlightModeSettingsStabilization3SettingsArrayGet((FlightModeSettingsStabilization3SettingsOptions *)modes);
|
||||
break;
|
||||
case 4:
|
||||
FlightModeSettingsStabilization4SettingsArrayGet((FlightModeSettingsStabilization4SettingsOptions*) modes);
|
||||
FlightModeSettingsStabilization4SettingsArrayGet((FlightModeSettingsStabilization4SettingsOptions *)modes);
|
||||
break;
|
||||
case 5:
|
||||
FlightModeSettingsStabilization5SettingsArrayGet((FlightModeSettingsStabilization5SettingsOptions*) modes);
|
||||
FlightModeSettingsStabilization5SettingsArrayGet((FlightModeSettingsStabilization5SettingsOptions *)modes);
|
||||
break;
|
||||
case 6:
|
||||
FlightModeSettingsStabilization6SettingsArrayGet((FlightModeSettingsStabilization6SettingsOptions*) modes);
|
||||
FlightModeSettingsStabilization6SettingsArrayGet((FlightModeSettingsStabilization6SettingsOptions *)modes);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
|
@ -170,7 +170,7 @@ static void airspeedTask(__attribute__((unused)) void *parameters)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch (airspeedSettings.AirspeedSensorType) {
|
||||
|
@ -96,27 +96,27 @@ void stabilizedHandler(bool newinit)
|
||||
|
||||
switch (flightStatus.FlightMode) {
|
||||
case FLIGHTSTATUS_FLIGHTMODE_STABILIZED1:
|
||||
stab_settings = (uint8_t*) FlightModeSettingsStabilization1SettingsToArray(settings.Stabilization1Settings);
|
||||
stab_settings = (uint8_t *)FlightModeSettingsStabilization1SettingsToArray(settings.Stabilization1Settings);
|
||||
break;
|
||||
case FLIGHTSTATUS_FLIGHTMODE_STABILIZED2:
|
||||
stab_settings = (uint8_t*) FlightModeSettingsStabilization2SettingsToArray(settings.Stabilization2Settings);
|
||||
stab_settings = (uint8_t *)FlightModeSettingsStabilization2SettingsToArray(settings.Stabilization2Settings);
|
||||
break;
|
||||
case FLIGHTSTATUS_FLIGHTMODE_STABILIZED3:
|
||||
stab_settings = (uint8_t*) FlightModeSettingsStabilization3SettingsToArray(settings.Stabilization3Settings);
|
||||
stab_settings = (uint8_t *)FlightModeSettingsStabilization3SettingsToArray(settings.Stabilization3Settings);
|
||||
break;
|
||||
case FLIGHTSTATUS_FLIGHTMODE_STABILIZED4:
|
||||
stab_settings = (uint8_t*) FlightModeSettingsStabilization4SettingsToArray(settings.Stabilization4Settings);
|
||||
stab_settings = (uint8_t *)FlightModeSettingsStabilization4SettingsToArray(settings.Stabilization4Settings);
|
||||
break;
|
||||
case FLIGHTSTATUS_FLIGHTMODE_STABILIZED5:
|
||||
stab_settings = (uint8_t*) FlightModeSettingsStabilization5SettingsToArray(settings.Stabilization5Settings);
|
||||
stab_settings = (uint8_t *)FlightModeSettingsStabilization5SettingsToArray(settings.Stabilization5Settings);
|
||||
break;
|
||||
case FLIGHTSTATUS_FLIGHTMODE_STABILIZED6:
|
||||
stab_settings = (uint8_t*) FlightModeSettingsStabilization6SettingsToArray(settings.Stabilization6Settings);
|
||||
stab_settings = (uint8_t *)FlightModeSettingsStabilization6SettingsToArray(settings.Stabilization6Settings);
|
||||
break;
|
||||
default:
|
||||
// Major error, this should not occur because only enter this block when one of these is true
|
||||
AlarmsSet(SYSTEMALARMS_ALARM_MANUALCONTROL, SYSTEMALARMS_ALARM_CRITICAL);
|
||||
stab_settings = (uint8_t*) FlightModeSettingsStabilization1SettingsToArray(settings.Stabilization1Settings);
|
||||
stab_settings = (uint8_t *)FlightModeSettingsStabilization1SettingsToArray(settings.Stabilization1Settings);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -313,9 +313,9 @@ int8_t VtolBrakeController::UpdateStabilizationDesired(void)
|
||||
thrustMode = FLIGHTMODESETTINGS_STABILIZATION1SETTINGS_ALTITUDEVARIO;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
stabDesired.StabilizationMode.Thrust = (StabilizationDesiredStabilizationModeOptions) thrustMode;
|
||||
stabDesired.StabilizationMode.Thrust = (StabilizationDesiredStabilizationModeOptions)thrustMode;
|
||||
}
|
||||
|
||||
// set the thrust value
|
||||
|
@ -69,7 +69,7 @@ bool UAVObjectGeneratorFlight::generate(UAVObjectParser *parser, QString templat
|
||||
flightInitTemplate.replace(QString("$(OBJINC)"), objInc);
|
||||
flightInitTemplate.replace(QString("$(OBJINIT)"), flightObjInit);
|
||||
bool res = writeFileIfDifferent(flightOutputPath.absolutePath() + "/uavobjectsinit.c",
|
||||
flightInitTemplate);
|
||||
flightInitTemplate);
|
||||
if (!res) {
|
||||
cout << "Error: Could not write flight object init file" << endl;
|
||||
return false;
|
||||
@ -78,7 +78,7 @@ bool UAVObjectGeneratorFlight::generate(UAVObjectParser *parser, QString templat
|
||||
// Write the flight object initialization header
|
||||
flightInitIncludeTemplate.replace(QString("$(SIZECALCULATION)"), QString().setNum(sizeCalc));
|
||||
res = writeFileIfDifferent(flightOutputPath.absolutePath() + "/uavobjectsinit.h",
|
||||
flightInitIncludeTemplate);
|
||||
flightInitIncludeTemplate);
|
||||
if (!res) {
|
||||
cout << "Error: Could not write flight object init header file" << endl;
|
||||
return false;
|
||||
@ -88,7 +88,7 @@ bool UAVObjectGeneratorFlight::generate(UAVObjectParser *parser, QString templat
|
||||
flightMakeTemplate.replace(QString("$(UAVOBJFILENAMES)"), objFileNames);
|
||||
flightMakeTemplate.replace(QString("$(UAVOBJNAMES)"), objNames);
|
||||
res = writeFileIfDifferent(flightOutputPath.absolutePath() + "/Makefile.inc",
|
||||
flightMakeTemplate);
|
||||
flightMakeTemplate);
|
||||
if (!res) {
|
||||
cout << "Error: Could not write flight Makefile" << endl;
|
||||
return false;
|
||||
@ -119,14 +119,10 @@ bool UAVObjectGeneratorFlight::process_object(ObjectInfo *info)
|
||||
// that StringList here for use below.
|
||||
//
|
||||
QStringList typeList;
|
||||
for (int n = 0; n < info->fields.length(); ++n)
|
||||
{
|
||||
if (info->fields[n]->type == FIELDTYPE_ENUM)
|
||||
{
|
||||
for (int n = 0; n < info->fields.length(); ++n) {
|
||||
if (info->fields[n]->type == FIELDTYPE_ENUM) {
|
||||
typeList << QString("%1%2Options").arg(info->name).arg(info->fields[n]->name);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
typeList << fieldTypeStrC[info->fields[n]->type];
|
||||
}
|
||||
}
|
||||
@ -276,7 +272,6 @@ bool UAVObjectGeneratorFlight::process_object(ObjectInfo *info)
|
||||
{
|
||||
// For non-array fields
|
||||
if (info->fields[n]->numElements == 1) {
|
||||
|
||||
/* Set */
|
||||
setgetfields.append(QString("void %2%3Set(%1 *New%3)\n")
|
||||
.arg(typeList[n])
|
||||
|
@ -94,7 +94,7 @@ bool UAVObjectGeneratorWireshark::generate(UAVObjectParser *parser, QString temp
|
||||
/* Write the uavobject dissector's Makefile.common */
|
||||
wiresharkMakeTemplate.replace(QString("$(UAVOBJFILENAMES)"), objFileNames);
|
||||
bool res = writeFileIfDifferent(uavobjectsOutputPath.absolutePath() + "/Makefile.common",
|
||||
wiresharkMakeTemplate);
|
||||
wiresharkMakeTemplate);
|
||||
if (!res) {
|
||||
cout << "Error: Could not write wireshark Makefile" << endl;
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user