75 parserbuf[*parserbuf_index] = c;
87 parserbuf[*parserbuf_index] = c;
96 parserbuf[*parserbuf_index] = c;
101 *parserbuf_index = 0;
108 parserbuf[*parserbuf_index] = c;
109 (*parserbuf_index)++;
115 parserbuf[*parserbuf_index] = c;
116 (*parserbuf_index)++;
122 parserbuf[*parserbuf_index] = c;
123 (*parserbuf_index)++;
129 parserbuf[*parserbuf_index] = c;
130 (*parserbuf_index)++;
136 parserbuf[*parserbuf_index] = c;
137 (*parserbuf_index)++;
143 parserbuf[*parserbuf_index] = c;
144 (*parserbuf_index)++;
150 unsigned char cksm = 0;
152 for (
int i = 0; i < 8; i++) {
153 cksm += parserbuf[i];
157 parserbuf[*parserbuf_index] =
'\0';
158 unsigned int t1 = parserbuf[2];
159 unsigned int t2 = parserbuf[3];
162 *dist = ((float)t2) / 100;
164 *parserbuf_index = 0;
169 *parserbuf_index = 0;
176 printf(
"state: TFMINI_PARSE_STATE%s\n",
parser_state[*state]);
int tfmini_parse(char c, char *parserbuf, unsigned *parserbuf_index, TFMINI_PARSE_STATE *state, float *dist)
static struct hrt_call t1
static crsf_parser_state_t parser_state