1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

uncrustify

This commit is contained in:
Philippe Renon 2016-01-04 21:41:45 +01:00
parent f7271df0e5
commit 6b39fc0800
6 changed files with 46 additions and 50 deletions

View File

@ -99,7 +99,7 @@ static uint8_t isAssistedFlightMode(uint8_t position);
static void applyLPF(float *value, ManualControlSettingsResponseTimeElem channel, ManualControlSettingsResponseTimeData *responseTime, uint8_t deadband, float dT);
#endif
#define RCVR_ACTIVITY_MONITOR_CHANNELS_PER_GROUP 18 // Sbus max channel
#define RCVR_ACTIVITY_MONITOR_CHANNELS_PER_GROUP 18 // Sbus max channel
#define RCVR_ACTIVITY_MONITOR_MIN_RANGE 15
struct rcvr_activity_fsm {
ManualControlSettingsChannelGroupsOptions group;

View File

@ -114,8 +114,8 @@ typedef struct {
#endif /* PIOS_TELEM_PRIORITY_QUEUE */
// Transmit/receive task handles
xTaskHandle txTaskHandle;
xTaskHandle rxTaskHandle;
xTaskHandle txTaskHandle;
xTaskHandle rxTaskHandle;
// Telemetry stream
UAVTalkConnection uavTalkCon;
} channelContext;
@ -170,7 +170,6 @@ static void gcsTelemetryStatsUpdated();
*/
int32_t TelemetryStart(void)
{
#ifdef HAS_RADIO
// Only start the local telemetry tasks if needed
if (localPort()) {
@ -623,7 +622,6 @@ static void telemetryTxTask(void *parameters)
processObjEvent(channel, &ev);
}
#endif /* PIOS_TELEM_PRIORITY_QUEUE */
}
}

View File

@ -238,13 +238,13 @@ static bool erase_flash(uint32_t startAddress, uint32_t endAddress)
PIOS_Assert(0);
}
for (int retry = 0; retry < MAX_DEL_RETRYS; ++retry) {
//if erasing area contain whole bank2 area, using bank erase
//bank2: sector 12 to sector 23
// if erasing area contain whole bank2 area, using bank erase
// bank2: sector 12 to sector 23
if (sector_start == flash_sectors[12].start &&
endAddress >= (flash_sectors[23].start + flash_sectors[23].size)){
endAddress >= (flash_sectors[23].start + flash_sectors[23].size)) {
if (FLASH_EraseAllBank2Sectors(VoltageRange_3) == FLASH_COMPLETE) {
fail = false;
//using bank2 total size substitute sector_size
// using bank2 total size substitute sector_size
sector_size = flash_sectors[23].start - flash_sectors[12].start + flash_sectors[23].size;
break;
} else {

View File

@ -74,7 +74,7 @@ void PIOS_SYS_Init(void)
RCC_AHB1Periph_GPIOC |
RCC_AHB1Periph_GPIOD |
RCC_AHB1Periph_GPIOE |
#if defined (STM32F40_41xxx) || defined (STM32F427_437xx) || defined (STM32F429_439xx)
#if defined(STM32F40_41xxx) || defined(STM32F427_437xx) || defined(STM32F429_439xx)
RCC_AHB1Periph_GPIOF |
RCC_AHB1Periph_GPIOG |
RCC_AHB1Periph_GPIOH |
@ -85,7 +85,7 @@ void PIOS_SYS_Init(void)
RCC_AHB1Periph_SRAM1 |
RCC_AHB1Periph_SRAM2 |
RCC_AHB1Periph_BKPSRAM |
#if defined (STM32F427_437xx) || defined (STM32F429_439xx)
#if defined(STM32F427_437xx) || defined(STM32F429_439xx)
RCC_AHB1Periph_SRAM3 |
#endif
RCC_AHB1Periph_DMA1 |
@ -174,7 +174,7 @@ void PIOS_SYS_Init(void)
GPIO_Init(GPIOD, &GPIO_InitStructure);
GPIO_Init(GPIOE, &GPIO_InitStructure);
#if defined (STM32F40_41xxx) || defined (STM32F427_437xx) || defined (STM32F429_439xx)
#if defined(STM32F40_41xxx) || defined(STM32F427_437xx) || defined(STM32F429_439xx)
GPIO_Init(GPIOF, &GPIO_InitStructure);
GPIO_Init(GPIOG, &GPIO_InitStructure);
GPIO_Init(GPIOH, &GPIO_InitStructure);

View File

@ -770,30 +770,30 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch
case VehicleConfigurationSource::MULTI_ROTOR_HEXA:
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_H:
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_X:
mSettings->setMixerValueRoll((qint8) 100);
mSettings->setMixerValuePitch((qint8) 100);
mSettings->setMixerValueYaw((qint8) 100);
mSettings->setMixerValueRoll((qint8)100);
mSettings->setMixerValuePitch((qint8)100);
mSettings->setMixerValueYaw((qint8)100);
break;
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X:
mSettings->setMixerValueRoll((qint8) 50);
mSettings->setMixerValuePitch((qint8) 50);
mSettings->setMixerValueYaw((qint8) 50);
mSettings->setMixerValueRoll((qint8)50);
mSettings->setMixerValuePitch((qint8)50);
mSettings->setMixerValueYaw((qint8)50);
break;
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS:
mSettings->setMixerValueRoll((qint8) 100);
mSettings->setMixerValuePitch((qint8) 100);
mSettings->setMixerValueYaw((qint8) 50);
mSettings->setMixerValueRoll((qint8)100);
mSettings->setMixerValuePitch((qint8)100);
mSettings->setMixerValueYaw((qint8)50);
break;
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_COAX_Y:
mSettings->setMixerValueRoll((qint8) 100);
mSettings->setMixerValuePitch((qint8) 50);
mSettings->setMixerValueYaw((qint8) 66);
mSettings->setMixerValueRoll((qint8)100);
mSettings->setMixerValuePitch((qint8)50);
mSettings->setMixerValueYaw((qint8)66);
break;
case VehicleConfigurationSource::MULTI_ROTOR_OCTO:
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_X:
mSettings->setMixerValueRoll((qint8) 100);
mSettings->setMixerValuePitch((qint8) 100);
mSettings->setMixerValueYaw((qint8) 100);
mSettings->setMixerValueRoll((qint8)100);
mSettings->setMixerValuePitch((qint8)100);
mSettings->setMixerValueYaw((qint8)100);
break;
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_X:
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS:
@ -805,9 +805,9 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch
break;
}
case VehicleConfigurationSource::VEHICLE_FIXEDWING:
mSettings->setMixerValueRoll((qint8) 100);
mSettings->setMixerValuePitch((qint8) 100);
mSettings->setMixerValueYaw((qint8) 100);
mSettings->setMixerValueRoll((qint8)100);
mSettings->setMixerValuePitch((qint8)100);
mSettings->setMixerValueYaw((qint8)100);
maxThrottle = 1;
break;
case VehicleConfigurationSource::VEHICLE_HELI:
@ -816,22 +816,22 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch
{
switch (m_configSource->getVehicleSubType()) {
case VehicleConfigurationSource::GROUNDVEHICLE_MOTORCYCLE:
mSettings->setMixerValueRoll((qint8) 100);
mSettings->setMixerValuePitch((qint8) 100);
mSettings->setMixerValueYaw((qint8) 100);
mSettings->setMixerValueRoll((qint8)100);
mSettings->setMixerValuePitch((qint8)100);
mSettings->setMixerValueYaw((qint8)100);
maxThrottle = 1;
break;
case VehicleConfigurationSource::GROUNDVEHICLE_CAR:
mSettings->setMixerValueRoll((qint8) 100);
mSettings->setMixerValuePitch((qint8) 100);
mSettings->setMixerValueYaw((qint8) 100);
mSettings->setMixerValueRoll((qint8)100);
mSettings->setMixerValuePitch((qint8)100);
mSettings->setMixerValueYaw((qint8)100);
maxThrottle = 1;
minThrottle = 0;
break;
case VehicleConfigurationSource::GROUNDVEHICLE_DIFFERENTIAL:
mSettings->setMixerValueRoll((qint8) 100);
mSettings->setMixerValuePitch((qint8) 100);
mSettings->setMixerValueYaw((qint8) 100);
mSettings->setMixerValueRoll((qint8)100);
mSettings->setMixerValuePitch((qint8)100);
mSettings->setMixerValueYaw((qint8)100);
maxThrottle = 0.8;
minThrottle = 0;
break;

View File

@ -627,24 +627,22 @@ bool UAVObjectGeneratorGCS::process_object(ObjectInfo *object)
// field context
FieldContext fieldCtxt;
fieldCtxt.field = field;
fieldCtxt.field = field;
// field properties
fieldCtxt.fieldName = field->name;
fieldCtxt.fieldType = fieldTypeStrCPP(field->type);
fieldCtxt.fieldName = field->name;
fieldCtxt.fieldType = fieldTypeStrCPP(field->type);
fieldCtxt.ucPropName = toPropertyName(field->name);
fieldCtxt.propName = toLowerCamelCase(fieldCtxt.ucPropName);
fieldCtxt.propType = fieldCtxt.fieldType;
fieldCtxt.ucPropName = toPropertyName(field->name);
fieldCtxt.propName = toLowerCamelCase(fieldCtxt.ucPropName);
fieldCtxt.propType = fieldCtxt.fieldType;
if (field->type == FIELDTYPE_INT8) {
fieldCtxt.propType = fieldTypeStrCPP(FIELDTYPE_INT16);
}
else if (field->type == FIELDTYPE_UINT8) {
} else if (field->type == FIELDTYPE_UINT8) {
fieldCtxt.propType = fieldTypeStrCPP(FIELDTYPE_UINT16);
}
else if (field->type == FIELDTYPE_ENUM) {
} else if (field->type == FIELDTYPE_ENUM) {
QString enumClassName = object->name + "_" + fieldCtxt.ucPropName;
fieldCtxt.propType = enumClassName + "::Enum";
fieldCtxt.propType = enumClassName + "::Enum";
}
// reference type
fieldCtxt.propRefType = fieldCtxt.propType;