Rev 1910 | Rev 1926 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1910 | Rev 1922 | ||
---|---|---|---|
Line 9... | Line 9... | ||
9 | #include "output.h" |
9 | #include "output.h" |
Line 10... | Line 10... | ||
10 | 10 | ||
11 | uint16_t maxControl[2] = {0, 0}; |
11 | uint16_t maxControl[2] = {0, 0}; |
12 | uint16_t controlActivity = 0; |
12 | uint16_t controlActivity = 0; |
13 | int16_t control[4] = {0, 0, 0, 0}; |
13 | int16_t control[4] = {0, 0, 0, 0}; |
Line 14... | Line 14... | ||
14 | int32_t controlIntegrals[4] = {0, 0, 0, 0}; |
14 | // int32_t controlIntegrals[4] = {0, 0, 0, 0}; |
15 | 15 | ||
16 | // Internal variables for reading commands made with an R/C stick. |
16 | // Internal variables for reading commands made with an R/C stick. |
Line 86... | Line 86... | ||
86 | 86 | ||
87 | void updateControlAndMeasureControlActivity(uint8_t index, int16_t newValue) { |
87 | void updateControlAndMeasureControlActivity(uint8_t index, int16_t newValue) { |
Line 88... | Line 88... | ||
88 | int16_t tmp = control[index]; |
88 | int16_t tmp = control[index]; |
89 | 89 | ||
Line -... | Line 90... | ||
- | 90 | // TODO: Scale by some factor. To be determined. |
|
90 | // TODO: Scale by some factor. To be determined. |
91 | // controlIntegrals[index] += tmp * 4; |
91 | controlIntegrals[index] += tmp * 4; |
92 | |
92 | 93 | /* |
|
93 | if (controlIntegrals[index] > PITCHROLLOVER180) { |
94 | if (controlIntegrals[index] > PITCHROLLOVER180) { |
94 | controlIntegrals[index] -= PITCHROLLOVER360; |
95 | controlIntegrals[index] -= PITCHROLLOVER360; |
- | 96 | } else if (controlIntegrals[index] <= -PITCHROLLOVER180) { |
|
Line 95... | Line 97... | ||
95 | } else if (controlIntegrals[index] <= -PITCHROLLOVER180) { |
97 | controlIntegrals[index] += PITCHROLLOVER360; |
96 | controlIntegrals[index] += PITCHROLLOVER360; |
98 | } |
97 | } |
99 | */212e |
98 | 100 |