Subversion Repositories FlightCtrl

Rev

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

Rev 2109 Rev 2116
Line 127... Line 127...
127
  return value + NEUTRAL_PULSELENGTH;
127
  return value + NEUTRAL_PULSELENGTH;
128
}
128
}
Line 129... Line 129...
129
 
129
 
130
void calculateControlServoValues(void) {
130
void calculateControlServoValues(void) {
-
 
131
  int16_t value;
-
 
132
  int16_t minLimit = staticParams.controlServoMinValue * SCALE_FACTOR;
131
  int16_t value;
133
  int16_t maxLimit = staticParams.controlServoMaxValue * SCALE_FACTOR;
132
  for (uint8_t axis=0; axis<4; axis++) {
134
  for (uint8_t axis=0; axis<4; axis++) {
133
        value = controlServos[axis];
135
        value = controlServos[axis];
-
 
136
        value *= 2;
-
 
137
        if (value < minLimit) value = minLimit;
134
        value *= 2;
138
        else if (value > maxLimit) value = maxLimit;
135
        servoValues[axis] = value + NEUTRAL_PULSELENGTH;
139
        servoValues[axis] = value + NEUTRAL_PULSELENGTH;
136
  }
140
  }
137
  debugOut.analog[24] = servoValues[0];
141
  debugOut.analog[24] = servoValues[0];
138
  debugOut.analog[25] = servoValues[1];
142
  debugOut.analog[25] = servoValues[1];