Rev 1821 | Rev 1869 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1821 | Rev 1868 | ||
---|---|---|---|
Line 30... | Line 30... | ||
30 | // + this list of conditions and the following disclaimer. |
30 | // + this list of conditions and the following disclaimer. |
31 | // + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
31 | // + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
32 | // + from this software without specific prior written permission. |
32 | // + from this software without specific prior written permission. |
33 | // + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
33 | // + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
34 | // + for non-commercial use (directly or indirectly) |
34 | // + for non-commercial use (directly or indirectly) |
35 | // + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
35 | // + Commercial use (for example: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
36 | // + with our written permission |
36 | // + with our written permission |
37 | // + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
37 | // + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
38 | // + clearly linked as origin |
38 | // + clearly linked as origin |
39 | // + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
39 | // + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
40 | // + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
40 | // + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Line 127... | Line 127... | ||
127 | /********************************************************************/ |
127 | /********************************************************************/ |
128 | /* Every time a positive edge is detected at PD6 */ |
128 | /* Every time a positive edge is detected at PD6 */ |
129 | /********************************************************************/ |
129 | /********************************************************************/ |
130 | /* t-Frame |
130 | /* t-Frame |
131 | <-----------------------------------------------------------------------> |
131 | <-----------------------------------------------------------------------> |
132 | ____ ______ _____ ________ ______ sync gap ____ |
132 | ____ ______ _____ ________ ______ sync gap ____ |
133 | | | | | | | | | | | | |
133 | | | | | | | | | | | | |
134 | | | | | | | | | | | | |
134 | | | | | | | | | | | | |
135 | ___| |_| |_| |_| |_.............| |________________| |
135 | ___| |_| |_| |_| |_.............| |________________| |
136 | <-----><-------><------><--------> <------> <--- |
136 | <-----><-------><------><--------> <------> <--- |
137 | t0 t1 t2 t4 tn t0 |
137 | t0 t1 t2 t4 tn t0 |
Line 138... | Line 138... | ||
138 | 138 | ||
139 | The PPM-Frame length is 22.5 ms. |
139 | The PPM-Frame length is 22.5 ms. |
140 | Channel high pulse width range is 0.7 ms to 1.7 ms completed by an 0.3 ms low pulse. |
140 | Channel high pulse width range is 0.7 ms to 1.7 ms completed by an 0.3 ms low pulse. |
Line 249... | Line 249... | ||
249 | if (RC_Quality) { |
249 | if (RC_Quality) { |
250 | RC_Quality--; |
250 | RC_Quality--; |
251 | if (NewPpmData-- == 0) { |
251 | if (NewPpmData-- == 0) { |
252 | RC_PRTY[CONTROL_PITCH] = RCChannel(CH_PITCH) * staticParams.StickP |
252 | RC_PRTY[CONTROL_PITCH] = RCChannel(CH_PITCH) * staticParams.StickP |
253 | + RCDiff(CH_PITCH) * staticParams.StickD; |
253 | + RCDiff(CH_PITCH) * staticParams.StickD; |
- | 254 | ||
- | 255 | DebugOut.Analog[21] = RCChannel(CH_THROTTLE); |
|
- | 256 | ||
254 | RC_PRTY[CONTROL_ROLL] = RCChannel(CH_ROLL) * staticParams.StickP |
257 | RC_PRTY[CONTROL_ROLL] = RCChannel(CH_ROLL) * staticParams.StickP |
255 | + RCDiff(CH_ROLL) * staticParams.StickD; |
258 | + RCDiff(CH_ROLL) * staticParams.StickD; |
256 | RC_PRTY[CONTROL_THROTTLE] = RCChannel(CH_THROTTLE) + RCDiff(CH_THROTTLE) |
259 | RC_PRTY[CONTROL_THROTTLE] = RCChannel(CH_THROTTLE) + RCDiff(CH_THROTTLE) |
257 | * dynamicParams.UserParams[3] + 120; |
260 | * dynamicParams.UserParams[3] + 120; |
258 | if (RC_PRTY[CONTROL_THROTTLE] < 0) |
261 | if (RC_PRTY[CONTROL_THROTTLE] < 0) |