Rev 1276 | Rev 1283 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1276 | Rev 1278 | ||
---|---|---|---|
Line 28... | Line 28... | ||
28 | AdNeutralGier = 0; |
28 | AdNeutralGier = 0; |
29 | AdNeutralRoll = 0; |
29 | AdNeutralRoll = 0; |
30 | AdNeutralNick = 0; |
30 | AdNeutralNick = 0; |
31 | return; |
31 | return; |
32 | } |
32 | } |
- | 33 | /* |
|
- | 34 | //############################################################################ |
|
- | 35 | //Diese Routine startet und inizialisiert den Timer für RC |
|
- | 36 | SIGNAL(SIG_INPUT_CAPTURE1) |
|
- | 37 | //############################################################################ |
|
- | 38 | ||
- | 39 | { |
|
- | 40 | static unsigned int AltICR=0; |
|
- | 41 | signed int signal = 0,tmp; |
|
- | 42 | static int index; |
|
- | 43 | |
|
- | 44 | signal = (unsigned int) ICR1 - AltICR; |
|
- | 45 | AltICR = ICR1; |
|
- | 46 | //Syncronisationspause? |
|
- | 47 | if((signal > 1100) && (signal < 8000)) |
|
- | 48 | { |
|
- | 49 | if(index >= 4) NewPpmData = 0; // Null bedeutet: Neue Daten |
|
- | 50 | index = 1; |
|
- | 51 | } |
|
- | 52 | else |
|
- | 53 | { |
|
- | 54 | if(index < 10) |
|
- | 55 | { |
|
- | 56 | if((signal > 250) && (signal < 687)) |
|
- | 57 | { |
|
- | 58 | signal -= 466; |
|
- | 59 | // Stabiles Signal |
|
- | 60 | if(abs(signal - PPM_in[index]) < 6) { if(SenderOkay < 200) SenderOkay += 10; else SenderOkay = 200;} |
|
- | 61 | tmp = (3 * (PPM_in[index]) + signal) / 4; |
|
- | 62 | if(tmp > signal+1) tmp--; else |
|
- | 63 | if(tmp < signal-1) tmp++; |
|
- | 64 | if(SenderOkay >= 195) PPM_diff[index] = ((tmp - PPM_in[index]) / 3) * 3; |
|
- | 65 | else PPM_diff[index] = 0; |
|
- | 66 | PPM_in[index] = tmp; |
|
- | 67 | } |
|
- | 68 | index++; |
|
- | 69 | if(index == 5) J3High; else J3Low; // Servosignal an J3 anlegen |
|
- | 70 | if(index == 6) J4High; else J4Low; // Servosignal an J4 anlegen |
|
- | 71 | if(index == 7) J5High; else J5Low; // Servosignal an J5 anlegen |
|
- | 72 | } |
|
- | 73 | } |
|
- | 74 | } |
|
- | 75 | */ |
|
- | 76 | ||
Line 33... | Line 77... | ||
33 | 77 | ||
34 | //############################################################################ |
78 | //############################################################################ |
35 | //Diese Routine startet und inizialisiert den Timer für RC |
79 | //Diese Routine startet und inizialisiert den Timer für RC |
36 | SIGNAL(SIG_INPUT_CAPTURE1) |
80 | SIGNAL(SIG_INPUT_CAPTURE1) |
Line 67... | Line 111... | ||
67 | } |
111 | } |
68 | } |
112 | } |
69 | if(okay_cnt < 255) okay_cnt++; |
113 | if(okay_cnt < 255) okay_cnt++; |
70 | } |
114 | } |
71 | else |
115 | else |
- | 116 | { |
|
72 | if(okay_cnt > 100) okay_cnt = 10; else okay_cnt = 0; |
117 | if(okay_cnt > 100) okay_cnt = 10; else okay_cnt = 0; |
- | 118 | ROT_ON; |
|
- | 119 | } |
|
73 | index = 1; |
120 | index = 1; |
74 | if(!MotorenEin) Channels = tmpChannels; |
121 | if(!MotorenEin) Channels = tmpChannels; |
75 | } |
122 | } |
76 | else |
123 | else |
77 | { |
124 | { |
Line 98... | Line 145... | ||
98 | else ROT_ON; |
145 | else ROT_ON; |
99 | if(index == 5) J3High; else J3Low; // Servosignal an J3 anlegen |
146 | if(index == 5) J3High; else J3Low; // Servosignal an J3 anlegen |
100 | if(index == 6) J4High; else J4Low; // Servosignal an J4 anlegen |
147 | if(index == 6) J4High; else J4Low; // Servosignal an J4 anlegen |
101 | if(index == 7) J5High; else J5Low; // Servosignal an J5 anlegen |
148 | if(index == 7) J5High; else J5Low; // Servosignal an J5 anlegen |
102 | } |
149 | } |
103 | else ROT_ON; |
- | |
104 | if(index < 20) index++; |
150 | if(index < 20) index++; |
105 | else |
151 | else |
106 | if(index == 20) |
152 | if(index == 20) |
107 | { |
153 | { |
108 | unsigned char i; |
154 | unsigned char i; |
- | 155 | ROT_ON; |
|
109 | index = 30; |
156 | index = 30; |
110 | for(i=0;i<11;i++) // restore from older data |
157 | for(i=0;i<11;i++) // restore from older data |
111 | { |
158 | { |
112 | PPM_in[i] = old_ppm_in[i]; |
159 | PPM_in[i] = old_ppm_in[i]; |
113 | PPM_diff[i] = 0; |
160 | PPM_diff[i] = 0; |
Line 117... | Line 164... | ||
117 | } |
164 | } |
118 | DebugOut.Analog[16] = okay_cnt; |
165 | DebugOut.Analog[16] = okay_cnt; |
119 | DebugOut.Analog[17] = PPM_in[2]; |
166 | DebugOut.Analog[17] = PPM_in[2]; |
120 | } |
167 | } |
Line -... | Line 168... | ||
- | 168 | ||
121 | 169 | ||
122 | /* |
170 | /* |
123 | //############################################################################ |
171 | //############################################################################ |
124 | //Diese Routine startet und inizialisiert den Timer für RC |
172 | //Diese Routine startet und inizialisiert den Timer für RC |
125 | SIGNAL(SIG_INPUT_CAPTURE1) |
173 | SIGNAL(SIG_INPUT_CAPTURE1) |