FreeCalypso > hg > themwi-system-sw
comparison sip-manual-out/rtp_rx.c @ 200:834656633fa0
sip-manual-out TFO: use is_hunt_fill mechanism
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 02 Apr 2023 17:44:23 -0800 |
parents | f8a33603288f |
children |
comparison
equal
deleted
inserted
replaced
199:e6c7ced3c031 | 200:834656633fa0 |
---|---|
30 static const uint8_t hdr_pattern[20] = {0, 1, 0, 1, 0, 1, 1, 0, 1, 0, | 30 static const uint8_t hdr_pattern[20] = {0, 1, 0, 1, 0, 1, 1, 0, 1, 0, |
31 0, 1, 1, 0, 1, 0, 1, 0, 0, 1}; | 31 0, 1, 1, 0, 1, 0, 1, 0, 0, 1}; |
32 | 32 |
33 static uint8_t is_hunt_buf[320]; | 33 static uint8_t is_hunt_buf[320]; |
34 static int is_state; | 34 static int is_state; |
35 static unsigned is_offset, is_bit_count; | 35 static unsigned is_offset, is_bit_count, is_hunt_fill; |
36 static uint32_t is_rx_word; | 36 static uint32_t is_rx_word; |
37 | 37 |
38 static void | 38 static void |
39 reset_is_hunt() | 39 reset_is_hunt() |
40 { | 40 { |
41 memset(is_hunt_buf, 0xFF, 320); | |
42 is_state = 0; | 41 is_state = 0; |
42 is_hunt_fill = 0; | |
43 } | 43 } |
44 | 44 |
45 static void | 45 static void |
46 is_rx_hunt(input_pos) | 46 is_rx_hunt(input_pos) |
47 unsigned input_pos; | 47 unsigned input_pos; |
61 input_pos * 16 + offset); | 61 input_pos * 16 + offset); |
62 is_offset = offset; | 62 is_offset = offset; |
63 is_state = 1; | 63 is_state = 1; |
64 is_bit_count = 0; | 64 is_bit_count = 0; |
65 is_rx_word = 0; | 65 is_rx_word = 0; |
66 is_hunt_fill = 0; | |
66 } | 67 } |
67 | 68 |
68 static void | 69 static void |
69 is_process_cmd() | 70 is_process_cmd() |
70 { | 71 { |
142 unsigned new_bit; | 143 unsigned new_bit; |
143 | 144 |
144 memmove(is_hunt_buf, is_hunt_buf + 16, 304); | 145 memmove(is_hunt_buf, is_hunt_buf + 16, 304); |
145 memcpy(is_hunt_buf + 304, input, 16); | 146 memcpy(is_hunt_buf + 304, input, 16); |
146 if (!is_state) { | 147 if (!is_state) { |
147 is_rx_hunt(input_pos); | 148 if (is_hunt_fill < 20) |
149 is_hunt_fill++; | |
150 if (is_hunt_fill == 20) | |
151 is_rx_hunt(input_pos); | |
148 return; | 152 return; |
149 } | 153 } |
150 new_bit = input[is_offset] & 1; | 154 new_bit = input[is_offset] & 1; |
151 is_rx_word <<= 1; | 155 is_rx_word <<= 1; |
152 is_rx_word |= new_bit; | 156 is_rx_word |= new_bit; |