Rev 1964 | Rev 1969 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1964 | Rev 1968 | ||
---|---|---|---|
Line 138... | Line 133... | ||
138 | 133 | ||
139 | The PPM-Frame length is 22.5 ms. |
134 | 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. |
135 | Channel high pulse width range is 0.7 ms to 1.7 ms completed by an 0.3 ms low pulse. |
141 | The mininimum time delay of two events coding a channel is ( 0.7 + 0.3) ms = 1 ms. |
136 | The mininimum time delay of two events coding a channel is ( 0.7 + 0.3) ms = 1 ms. |
Line 162... | Line 157... | ||
162 | 157 | ||
163 | //sync gap? (3.52 ms < signal < 25.6 ms) |
158 | //sync gap? (3.52 ms < signal < 25.6 ms) |
164 | if ((signal > 1100) && (signal < 8000)) { |
159 | if ((signal > 1100) && (signal < 8000)) { |
165 | // if a sync gap happens and there where at least 4 channels decoded before |
160 | // if a sync gap happens and there where at least 4 channels decoded before |
166 | // then the NewPpmData flag is reset indicating valid data in the PPM_in[] array. |
161 | // then the NewPpmData flag is reset indicating valid data in the PPM_in[] array. |
167 | if (index >= 4) { |
162 | if (index >= 3) { |
168 | NewPpmData = 0; // Null means NewData for the first 4 channels |
163 | NewPpmData = 0; // Null means NewData for the first 4 channels |
169 | } |
164 | } |
170 | // synchronize channel index |
165 | // synchronize channel index |
171 | index = 1; |
166 | index = 0; |
172 | } else { // within the PPM frame |
167 | } else { // within the PPM frame |
173 | if (index < MAX_CHANNELS - 1) { // PPM24 supports 12 channels |
168 | if (index < MAX_CHANNELS) { // PPM24 supports 12 channels |
174 | // check for valid signal length (0.8 ms < signal < 2.1984 ms) |
169 | // check for valid signal length (0.8 ms < signal < 2.1984 ms) |
175 | // signal range is from 1.0ms/3.2us = 312 to 2.0ms/3.2us = 625 |
170 | // signal range is from 1.0ms/3.2us = 312 to 2.0ms/3.2us = 625 |
176 | if ((signal > 250) && (signal < 687)) { |
171 | if ((signal > 250) && (signal < 687)) { |
177 | // shift signal to zero symmetric range -154 to 159 |
172 | // shift signal to zero symmetric range -154 to 159 |