Rev 1869 | Rev 1908 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1869 | Rev 1872 | ||
---|---|---|---|
Line 141... | Line 141... | ||
141 | */ |
141 | */ |
142 | void controlMixer_update(void) { |
142 | void controlMixer_update(void) { |
143 | // calculate Stick inputs by rc channels (P) and changing of rc channels (D) |
143 | // calculate Stick inputs by rc channels (P) and changing of rc channels (D) |
144 | // TODO: If no signal --> zero. |
144 | // TODO: If no signal --> zero. |
145 | uint8_t axis; |
145 | uint8_t axis; |
- | 146 | int16_t tempThrottle; |
|
Line 146... | Line 147... | ||
146 | 147 | ||
147 | // takes almost no time... |
148 | // takes almost no time... |
Line 148... | Line 149... | ||
148 | RC_update(); |
149 | RC_update(); |
Line 156... | Line 157... | ||
156 | int16_t* RC_PRTY = RC_getPRTY(); |
157 | int16_t* RC_PRTY = RC_getPRTY(); |
157 | int16_t* EC_PRTY = EC_getPRTY(); |
158 | int16_t* EC_PRTY = EC_getPRTY(); |
Line 158... | Line 159... | ||
158 | 159 | ||
159 | control[PITCH] = RC_PRTY[CONTROL_PITCH] + EC_PRTY[CONTROL_PITCH]; |
160 | control[PITCH] = RC_PRTY[CONTROL_PITCH] + EC_PRTY[CONTROL_PITCH]; |
160 | control[ROLL] = RC_PRTY[CONTROL_ROLL] + EC_PRTY[CONTROL_ROLL]; |
- | |
- | 161 | control[ROLL] = RC_PRTY[CONTROL_ROLL] + EC_PRTY[CONTROL_ROLL]; |
|
161 | // This can be a CPU time killer if the function implementations are inefficient. |
162 | |
162 | controlThrottle = AC_getThrottle(HC_getThrottle(RC_PRTY[CONTROL_THROTTLE] |
163 | tempThrottle = HC_getThrottle(RC_PRTY[CONTROL_THROTTLE] + EC_PRTY[CONTROL_THROTTLE]); |
- | 164 | controlThrottle = AC_getThrottle(tempThrottle); |
|
163 | + EC_PRTY[CONTROL_THROTTLE])); |
165 | |
Line 164... | Line 166... | ||
164 | controlYaw = RC_PRTY[CONTROL_YAW] + EC_PRTY[CONTROL_YAW]; |
166 | controlYaw = RC_PRTY[CONTROL_YAW] + EC_PRTY[CONTROL_YAW]; |
165 | 167 | ||
Line 216... | Line 218... | ||
216 | // Just set to false. There is no reason to check if the none-command was repeated anyway. |
218 | // Just set to false. There is no reason to check if the none-command was repeated anyway. |
217 | isCommandRepeated = 0; |
219 | isCommandRepeated = 0; |
218 | lastCommand = COMMAND_NONE; |
220 | lastCommand = COMMAND_NONE; |
219 | } |
221 | } |
Line -... | Line 222... | ||
- | 222 | ||
220 | 223 | /* |
|
221 | if (isCommandRepeated) |
224 | if (isCommandRepeated) |
222 | DebugOut.Digital[0] |= DEBUG_COMMANDREPEATED; |
225 | DebugOut.Digital[0] |= DEBUG_COMMANDREPEATED; |
223 | else |
226 | else |
224 | DebugOut.Digital[0] &= ~DEBUG_COMMANDREPEATED; |
227 | DebugOut.Digital[0] &= ~DEBUG_COMMANDREPEATED; |
225 | if (rcCommand) |
228 | if (rcCommand) |
226 | DebugOut.Digital[1] |= DEBUG_COMMANDREPEATED; |
229 | DebugOut.Digital[1] |= DEBUG_COMMANDREPEATED; |
227 | else |
230 | else |
228 | DebugOut.Digital[1] &= ~DEBUG_COMMANDREPEATED; |
231 | DebugOut.Digital[1] &= ~DEBUG_COMMANDREPEATED; |
229 | - | ||
230 | // part1 end. |
232 | */ |
Line 231... | Line 233... | ||
231 | } |
233 | } |
232 | 234 | ||
233 | // TODO: Integrate into command system. |
235 | // TODO: Integrate into command system. |