Rev 1869 | Rev 1962 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1869 | Rev 1872 | ||
---|---|---|---|
Line 259... | Line 259... | ||
259 | RC_PRTY[CONTROL_THROTTLE] = 0; // Throttle is non negative. |
259 | RC_PRTY[CONTROL_THROTTLE] = 0; // Throttle is non negative. |
260 | tmp1 = -RCChannel(CH_YAW) - RCDiff(CH_YAW); |
260 | tmp1 = -RCChannel(CH_YAW) - RCDiff(CH_YAW); |
261 | // exponential stick sensitivity in yawing rate |
261 | // exponential stick sensitivity in yawing rate |
262 | tmp2 = (int32_t) staticParams.StickYawP * ((int32_t) tmp1 * abs(tmp1)) |
262 | tmp2 = (int32_t) staticParams.StickYawP * ((int32_t) tmp1 * abs(tmp1)) |
263 | / 512L; // expo y = ax + bx^2 |
263 | / 512L; // expo y = ax + bx^2 |
264 | tmp2 += (staticParams.StickYawP * tmp1) / 4; |
264 | tmp2 += (staticParams.StickYawP * tmp1) >> 2; |
265 | RC_PRTY[CONTROL_YAW] = tmp2; |
265 | RC_PRTY[CONTROL_YAW] = tmp2; |
266 | } |
266 | } |
267 | uint8_t command = RC_getStickCommand(); |
267 | uint8_t command = RC_getStickCommand(); |
- | 268 | ||
268 | if (lastRCCommand == command) { |
269 | if (lastRCCommand == command) { |
269 | // Keep timer from overrunning. |
270 | // Keep timer from overrunning. |
270 | if (commandTimer < COMMAND_TIMER) |
271 | if (commandTimer < COMMAND_TIMER) |
271 | commandTimer++; |
272 | commandTimer++; |
272 | } else { |
273 | } else { |