Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2103 → Rev 2104

/branches/dongfang_FC_fixedwing/timer2.c
4,6 → 4,7
#include "output.h"
#include "flight.h"
#include "attitude.h"
#include "timer2.h"
 
// #define COARSERESOLUTION 1
 
22,7 → 23,6
#define CS2 (1<<CS21)
#endif
 
#define MAX_SERVOS 8
#define FRAMELEN ((NEUTRAL_PULSELENGTH + SERVOLIMIT) * staticParams.servoCount + 128)
#define MIN_PULSELENGTH (NEUTRAL_PULSELENGTH - SERVOLIMIT)
#define MAX_PULSELENGTH (NEUTRAL_PULSELENGTH + SERVOLIMIT)
144,13 → 144,13
// Save the computation cost of computing a new value before the old one is used.
if (!recalculateServoTimes) return;
 
for (axis=0; axis<2; axis++) {
value = featuredServoValue(axis);
servoValues[axis + 4] = value;
for (axis= MAX_CONTROL_SERVOS; axis<MAX_CONTROL_SERVOS+2; axis++) {
value = featuredServoValue(axis-MAX_CONTROL_SERVOS);
servoValues[axis] = value;
}
for (axis=2; axis<MAX_SERVOS; axis++) {
for (axis=MAX_CONTROL_SERVOS+2; axis<MAX_SERVOS; axis++) {
value = 128 * SCALE_FACTOR;
servoValues[axis + 4] = value;
servoValues[axis] = value;
}
 
recalculateServoTimes = 0;