Rev 1268 | Rev 1272 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1268 | Rev 1271 | ||
---|---|---|---|
Line 78... | Line 78... | ||
78 | { |
78 | { |
79 | if((signal > 250) && (signal < 687)) |
79 | if((signal > 250) && (signal < 687)) |
80 | { |
80 | { |
81 | signal -= 466; |
81 | signal -= 466; |
82 | // Stabiles Signal |
82 | // Stabiles Signal |
- | 83 | if((abs(signal - ppm_in[index]) < 6)) |
|
- | 84 | { |
|
- | 85 | if(okay_cnt > 25) { if(SenderOkay < 200) SenderOkay += 10; else SenderOkay = 200;} |
|
- | 86 | else |
|
83 | if((abs(signal - ppm_in[index]) < 6) && okay_cnt > 30) { if(SenderOkay < 200) SenderOkay += 5; else SenderOkay = 200;} |
87 | if(okay_cnt > 10) { if(SenderOkay < 200) SenderOkay += 2; else SenderOkay = 200;} |
- | 88 | } |
|
84 | tmp = (3 * (ppm_in[index]) + signal) / 4; |
89 | tmp = (3 * (ppm_in[index]) + signal) / 4; |
85 | if(tmp > signal+1) tmp--; else |
90 | if(tmp > signal+1) tmp--; else |
86 | if(tmp < signal-1) tmp++; |
91 | if(tmp < signal-1) tmp++; |
87 | if(SenderOkay >= 190) ppm_diff[index] = ((tmp - ppm_in[index]) / 3) * 3; |
92 | if(SenderOkay >= 190) ppm_diff[index] = ((tmp - ppm_in[index]) / 3) * 3; |
88 | else ppm_diff[index] = 0; |
93 | else ppm_diff[index] = 0; |
Line 105... | Line 110... | ||
105 | okay_cnt = 0; |
110 | okay_cnt = 0; |
106 | } |
111 | } |
107 | } |
112 | } |
108 | } |
113 | } |
109 | DebugOut.Analog[16] = okay_cnt; |
114 | DebugOut.Analog[16] = okay_cnt; |
- | 115 | DebugOut.Analog[17] = PPM_in[2]; |
|
110 | } |
116 | } |
Line 111... | Line 117... | ||
111 | 117 | ||
112 | /* |
118 | /* |
113 | //############################################################################ |
119 | //############################################################################ |