Rev 1872 | Rev 1874 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1872 | Rev 1873 | ||
---|---|---|---|
Line 436... | Line 436... | ||
436 | DebugOut.Analog[15] = throttleTerm; |
436 | DebugOut.Analog[15] = throttleTerm; |
Line 437... | Line 437... | ||
437 | 437 | ||
438 | for (i = 0; i < MAX_MOTORS; i++) { |
438 | for (i = 0; i < MAX_MOTORS; i++) { |
439 | int16_t tmp; |
439 | int16_t tmp; |
440 | if (MKFlags & MKFLAG_MOTOR_RUN && Mixer.Motor[i][MIX_THROTTLE] > 0) { |
440 | if (MKFlags & MKFLAG_MOTOR_RUN && Mixer.Motor[i][MIX_THROTTLE] > 0) { |
441 | tmp = throttleTerm * Mixer.Motor[i][MIX_THROTTLE]; |
441 | tmp = (int32_t)throttleTerm * Mixer.Motor[i][MIX_THROTTLE] / 64L; |
442 | tmp += term[PITCH] * Mixer.Motor[i][MIX_PITCH]; |
442 | tmp += (int32_t)term[PITCH] * Mixer.Motor[i][MIX_PITCH] / 64L; |
443 | tmp += term[ROLL] * Mixer.Motor[i][MIX_ROLL]; |
443 | tmp += (int32_t)term[ROLL] * Mixer.Motor[i][MIX_ROLL] / 64L; |
444 | tmp += yawTerm * Mixer.Motor[i][MIX_YAW]; |
444 | tmp += (int32_t)yawTerm * Mixer.Motor[i][MIX_YAW] / 64L; |
445 | tmp = tmp >> 6; |
445 | // tmp = tmp >> 6; |
446 | motorFilters[i] = motorFilter(tmp, motorFilters[i]); |
446 | motorFilters[i] = motorFilter(tmp, motorFilters[i]); |
447 | // Now we scale back down to a 0..255 range. |
447 | // Now we scale back down to a 0..255 range. |
Line 448... | Line 448... | ||
448 | tmp = motorFilters[i] / MOTOR_SCALING; |
448 | tmp = motorFilters[i] / MOTOR_SCALING; |