From 5e2aeeea76658b14f79cc6623540043f46904de8 Mon Sep 17 00:00:00 2001 From: Cliff Geerdes Date: Thu, 31 Jan 2013 05:38:10 -0500 Subject: [PATCH] Fixed tab stops in two c files. --- flight/Modules/Actuator/actuator.c | 8 +-- flight/Modules/CameraStab/camerastab.c | 78 +++++++++++++------------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/flight/Modules/Actuator/actuator.c b/flight/Modules/Actuator/actuator.c index f63c829b4..4f341d936 100644 --- a/flight/Modules/Actuator/actuator.c +++ b/flight/Modules/Actuator/actuator.c @@ -206,10 +206,10 @@ static void actuatorTask(void* parameters) // Check how long since last update thisSysTime = xTaskGetTickCount(); - // reuse dt in case of wraparound - // todo (theothercliff thinks this might be needed): - // if dT actually matters... - // fix it to know max value and subtract for currently correct dT on wrap + // reuse dt in case of wraparound + // todo: + // if dT actually matters... + // fix it to know max value and subtract for currently correct dT on wrap if(thisSysTime > lastSysTime) dT = (thisSysTime - lastSysTime) * (portTICK_RATE_MS * 0.001f); lastSysTime = thisSysTime; diff --git a/flight/Modules/CameraStab/camerastab.c b/flight/Modules/CameraStab/camerastab.c index c2eeea647..5bff857ef 100644 --- a/flight/Modules/CameraStab/camerastab.c +++ b/flight/Modules/CameraStab/camerastab.c @@ -161,11 +161,11 @@ static void attitudeUpdated(UAVObjEvent* ev) (float)SAMPLE_PERIOD_MS; csd->lastSysTime = thisSysTime; - // storage for elevon roll component before the pitch component has been generated - // we are guaranteed that the iteration order of i is roll pitch yaw - // that guarnteees this won't be used uninited, but the compiler doesn't know that - // so we init it or turn the warning/error off for each compiler - float elevon_roll = 0.0; + // storage for elevon roll component before the pitch component has been generated + // we are guaranteed that the iteration order of i is roll pitch yaw + // that guarnteees this won't be used uninited, but the compiler doesn't know that + // so we init it or turn the warning/error off for each compiler + float elevon_roll = 0.0; // process axes for (uint8_t i = 0; i < CAMERASTABSETTINGS_INPUT_NUMELEM; i++) { @@ -218,47 +218,47 @@ static void attitudeUpdated(UAVObjEvent* ev) applyFeedForward(i, dT_millis, &attitude, &cameraStab); #endif - // bounding for elevon mixing occurs on the unmixed output - // to limit the range of the mixed output you must limit the range - // of both the unmixed pitch and unmixed roll + // bounding for elevon mixing occurs on the unmixed output + // to limit the range of the mixed output you must limit the range + // of both the unmixed pitch and unmixed roll float output = bound((attitude + csd->inputs[i]) / cameraStab.OutputRange[i], 1.0f); // set output channels switch (i) { case CAMERASTABSETTINGS_INPUT_ROLL: - // we are guaranteed that the iteration order of i is roll pitch yaw - // for elevon mixing we simply grab the value for later use - if (cameraStab.GimbalType == CAMERASTABSETTINGS_GIMBALTYPE_ELEVONSSGYAWPITCHROLL) { - elevon_roll = output; - } - else { - CameraDesiredRollOrServo1Set(&output); - } + // we are guaranteed that the iteration order of i is roll pitch yaw + // for elevon mixing we simply grab the value for later use + if (cameraStab.GimbalType == CAMERASTABSETTINGS_GIMBALTYPE_ELEVONSSGYAWPITCHROLL) { + elevon_roll = output; + } + else { + CameraDesiredRollOrServo1Set(&output); + } break; case CAMERASTABSETTINGS_INPUT_PITCH: - // we are guaranteed that the iteration order of i is roll pitch yaw - // for elevon mixing we use the value we previously grabbed and set both s1 and s2 - if (cameraStab.GimbalType == CAMERASTABSETTINGS_GIMBALTYPE_ELEVONSSGYAWPITCHROLL) { - float elevon_pitch; - elevon_pitch = output; - output = (elevon_pitch + elevon_roll) / 2; - CameraDesiredRollOrServo1Set(&output); - // elevon reversing works like this: - // first use the normal reversing facilities to get servo 1 working in the correct direction - // for both roll and pitch - // then use the new reversing switches to reverse servo 2 roll and/or pitch as needed - if (cameraStab.ElevonSSGServo2RollReverse == CAMERASTABSETTINGS_ELEVONSSGSERVO2ROLLREVERSE_TRUE) { - elevon_roll = 1.0 - elevon_roll; - } - if (cameraStab.ElevonSSGServo2PitchReverse == CAMERASTABSETTINGS_ELEVONSSGSERVO2PITCHREVERSE_TRUE) { - elevon_pitch = 1.0 - elevon_pitch; - } - output = (elevon_pitch - elevon_roll) / 2; - CameraDesiredPitchOrServo2Set(&output); - } - else { - CameraDesiredPitchOrServo2Set(&output); - } + // we are guaranteed that the iteration order of i is roll pitch yaw + // for elevon mixing we use the value we previously grabbed and set both s1 and s2 + if (cameraStab.GimbalType == CAMERASTABSETTINGS_GIMBALTYPE_ELEVONSSGYAWPITCHROLL) { + float elevon_pitch; + elevon_pitch = output; + output = (elevon_pitch + elevon_roll) / 2; + CameraDesiredRollOrServo1Set(&output); + // elevon reversing works like this: + // first use the normal reversing facilities to get servo 1 working in the correct direction + // for both roll and pitch + // then use the new reversing switches to reverse servo 2 roll and/or pitch as needed + if (cameraStab.ElevonSSGServo2RollReverse == CAMERASTABSETTINGS_ELEVONSSGSERVO2ROLLREVERSE_TRUE) { + elevon_roll = 1.0 - elevon_roll; + } + if (cameraStab.ElevonSSGServo2PitchReverse == CAMERASTABSETTINGS_ELEVONSSGSERVO2PITCHREVERSE_TRUE) { + elevon_pitch = 1.0 - elevon_pitch; + } + output = (elevon_pitch - elevon_roll) / 2; + CameraDesiredPitchOrServo2Set(&output); + } + else { + CameraDesiredPitchOrServo2Set(&output); + } break; case CAMERASTABSETTINGS_INPUT_YAW: CameraDesiredYawSet(&output);