Subversion Repositories FlightCtrl

Rev

Rev 1612 | Rev 1821 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1612 Rev 1775
Line 220... Line 220...
220
        } else if(ServoPitchValue > ((int16_t)staticParams.ServoPitchMax * MULTIPLIER)) {
220
        } else if(ServoPitchValue > ((int16_t)staticParams.ServoPitchMax * MULTIPLIER)) {
221
          ServoPitchValue = (int16_t)staticParams.ServoPitchMax * MULTIPLIER;
221
          ServoPitchValue = (int16_t)staticParams.ServoPitchMax * MULTIPLIER;
222
        }
222
        }
223
        remainingPulseLength += ServoPitchValue - (256 / 2) * MULTIPLIER; // shift ServoPitchValue to center position
223
        remainingPulseLength += ServoPitchValue - (256 / 2) * MULTIPLIER; // shift ServoPitchValue to center position
224
        ServoPitchValue /= MULTIPLIER;
224
        ServoPitchValue /= MULTIPLIER;
225
        // DebugOut.Analog[20] = ServoPitchValue;
-
 
226
        break;
225
        break;
Line 227... Line 226...
227
       
226
       
228
      case 2: // Roll Compensation Servo
227
      case 2: // Roll Compensation Servo
229
        ServoRollOffset = (ServoRollOffset * 3 + (int16_t)80 * MULTIPLIER) / 4; // lowpass offset
228
        ServoRollOffset = (ServoRollOffset * 3 + (int16_t)80 * MULTIPLIER) / 4; // lowpass offset
Line 242... Line 241...
242
        } else if(ServoRollValue > ((int16_t)staticParams.ServoPitchMax * MULTIPLIER)) {
241
        } else if(ServoRollValue > ((int16_t)staticParams.ServoPitchMax * MULTIPLIER)) {
243
          ServoRollValue = (int16_t)staticParams.ServoPitchMax * MULTIPLIER;
242
          ServoRollValue = (int16_t)staticParams.ServoPitchMax * MULTIPLIER;
244
        }
243
        }
245
        remainingPulseLength += ServoRollValue - (256 / 2) * MULTIPLIER; // shift ServoRollValue to center position
244
        remainingPulseLength += ServoRollValue - (256 / 2) * MULTIPLIER; // shift ServoRollValue to center position
246
        ServoRollValue /= MULTIPLIER;
245
        ServoRollValue /= MULTIPLIER;
247
        //DebugOut.Analog[20] = ServoRollValue;
-
 
248
        break;
246
        break;
Line 249... Line 247...
249
       
247
       
250
      default: // other servo channels
248
      default: // other servo channels
251
        remainingPulseLength += 2 * PPM_in[ServoIndex]; // add channel value, factor of 2 because timer 1 increments 3.2µs
249
        remainingPulseLength += 2 * PPM_in[ServoIndex]; // add channel value, factor of 2 because timer 1 increments 3.2µs