Rev 2110 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2110 | Rev 2132 | ||
---|---|---|---|
Line 6... | Line 6... | ||
6 | #include "configuration.h" |
6 | #include "configuration.h" |
7 | #include "attitude.h" |
7 | #include "attitude.h" |
8 | #include "commands.h" |
8 | #include "commands.h" |
9 | #include "output.h" |
9 | #include "output.h" |
Line 10... | Line 10... | ||
10 | 10 | ||
Line 11... | Line 11... | ||
11 | int16_t controls[4] = { 0, 0, 0, 0 }; |
11 | int16_t controls[4] = { 0, 0, 0, -1024 }; |
12 | 12 | ||
13 | // Internal variables for reading commands made with an R/C stick. |
13 | // Internal variables for reading commands made with an R/C stick. |
Line 52... | Line 52... | ||
52 | void controlMixer_updateVariables(void) { |
52 | void controlMixer_updateVariables(void) { |
53 | uint8_t i; |
53 | uint8_t i; |
54 | int16_t targetvalue; |
54 | int16_t targetvalue; |
55 | for (i=0; i < VARIABLE_COUNT; i++) { |
55 | for (i=0; i < VARIABLE_COUNT; i++) { |
56 | targetvalue = RC_getVariable(i); |
56 | targetvalue = RC_getVariable(i); |
57 | // if (i<2) debugOut.analog[18+i] = targetvalue; |
- | |
58 | if (targetvalue < 0) |
57 | if (targetvalue < 0) |
59 | targetvalue = 0; |
58 | targetvalue = 0; |
60 | if (variables[i] < targetvalue && variables[i] < 255) |
59 | if (variables[i] < targetvalue && variables[i] < 255) |
61 | variables[i]++; |
60 | variables[i]++; |
62 | else if (variables[i] > 0 && variables[i] > targetvalue) |
61 | else if (variables[i] > 0 && variables[i] > targetvalue) |
Line 106... | Line 105... | ||
106 | * Update variables. |
105 | * Update variables. |
107 | * Decode commands but do not execute them. |
106 | * Decode commands but do not execute them. |
108 | */ |
107 | */ |
Line 109... | Line 108... | ||
109 | 108 | ||
110 | void controlMixer_periodicTask(void) { |
109 | void controlMixer_periodicTask(void) { |
Line 111... | Line 110... | ||
111 | int16_t tempPRYT[4] = { 0, 0, 0, 0 }; |
110 | int16_t tempPRYT[4] = { 0, 0, 0, RC_getZeroThrottle()}; |
112 | 111 | ||
113 | // Decode commands. |
112 | // Decode commands. |