process an array of pulses. n must be even */
| 213 | process an array of pulses. n must be even |
| 214 | */ |
| 215 | void AP_RCProtocol::process_pulse_list(const uint32_t *widths, uint16_t n, bool need_swap) |
| 216 | { |
| 217 | if (n & 1) { |
| 218 | return; |
| 219 | } |
| 220 | while (n) { |
| 221 | uint32_t widths0 = widths[0]; |
| 222 | uint32_t widths1 = widths[1]; |
| 223 | if (need_swap) { |
| 224 | uint32_t tmp = widths1; |
| 225 | widths1 = widths0; |
| 226 | widths0 = tmp; |
| 227 | } |
| 228 | widths1 -= widths0; |
| 229 | process_pulse(widths0, widths1); |
| 230 | widths += 2; |
| 231 | n -= 2; |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | bool AP_RCProtocol::process_byte(uint8_t byte, uint32_t baudrate) |
| 236 | { |