Rev 1844 | Rev 1864 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1844 | Rev 1845 | ||
---|---|---|---|
Line 52... | Line 52... | ||
52 | 52 | ||
53 | #include <stdlib.h> |
53 | #include <stdlib.h> |
54 | #include <avr/io.h> |
54 | #include <avr/io.h> |
55 | #include "eeprom.h" |
55 | #include "eeprom.h" |
- | 56 | #include "flight.h" |
|
Line 56... | Line 57... | ||
56 | #include "flight.h" |
57 | #include "output.h" |
57 | 58 | ||
58 | // Only for debug. Remove. |
59 | // Only for debug. Remove. |
Line 377... | Line 378... | ||
377 | //CHECK_MIN_MAX(yawTerm, - (MIN_YAWGAS / 2), (MIN_YAWGAS / 2)); |
378 | //CHECK_MIN_MAX(yawTerm, - (MIN_YAWGAS / 2), (MIN_YAWGAS / 2)); |
378 | } |
379 | } |
Line 379... | Line 380... | ||
379 | 380 | ||
380 | // FIXME: Throttle may exceed maxThrottle (there is no check no more). |
381 | // FIXME: Throttle may exceed maxThrottle (there is no check no more). |
381 | tmp_int = staticParams.MaxThrottle * CONTROL_SCALING; |
382 | tmp_int = staticParams.MaxThrottle * CONTROL_SCALING; |
382 | if (yawTerm < -(tmpInt - throttleTerm)) { |
383 | if (yawTerm < -(tmp_int - throttleTerm)) { |
383 | yawTerm = -(tmpInt - throttleTerm); |
384 | yawTerm = -(tmp_int - throttleTerm); |
384 | DebugOut.Digital[0] |= DEBUG_CLIP; |
385 | DebugOut.Digital[0] |= DEBUG_CLIP; |
385 | } else if (yawTerm > (tmpInt - throttleTerm)) { |
386 | } else if (yawTerm > (tmp_int - throttleTerm)) { |
386 | yawTerm = (tmpInt - throttleTerm); |
387 | yawTerm = (tmp_int - throttleTerm); |
387 | DebugOut.Digital[0] |= DEBUG_CLIP; |
388 | DebugOut.Digital[0] |= DEBUG_CLIP; |
388 | } |
389 | } |
389 | // CHECK_MIN_MAX(yawTerm, -(tmp_int - throttleTerm), (tmp_int - throttleTerm)); |
390 | // CHECK_MIN_MAX(yawTerm, -(tmp_int - throttleTerm), (tmp_int - throttleTerm)); |
390 | DebugOut.Digital[1] &= ~DEBUG_CLIP; |
391 | DebugOut.Digital[1] &= ~DEBUG_CLIP; |