Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 1844 → Rev 1845

/branches/dongfang_FC_rewrite/flight.c/flight.c
54,6 → 54,7
#include <avr/io.h>
#include "eeprom.h"
#include "flight.h"
#include "output.h"
 
// Only for debug. Remove.
//#include "analog.h"
379,11 → 380,11
 
// FIXME: Throttle may exceed maxThrottle (there is no check no more).
tmp_int = staticParams.MaxThrottle * CONTROL_SCALING;
if (yawTerm < -(tmpInt - throttleTerm)) {
yawTerm = -(tmpInt - throttleTerm);
if (yawTerm < -(tmp_int - throttleTerm)) {
yawTerm = -(tmp_int - throttleTerm);
DebugOut.Digital[0] |= DEBUG_CLIP;
} else if (yawTerm > (tmpInt - throttleTerm)) {
yawTerm = (tmpInt - throttleTerm);
} else if (yawTerm > (tmp_int - throttleTerm)) {
yawTerm = (tmp_int - throttleTerm);
DebugOut.Digital[0] |= DEBUG_CLIP;
}
// CHECK_MIN_MAX(yawTerm, -(tmp_int - throttleTerm), (tmp_int - throttleTerm));