57 "6_GOT_CARRIAGE_RETURN" 70 (*parserbuf_index) = 0;
76 if (c >=
'0' && c <=
'9') {
78 parserbuf[*parserbuf_index] = c;
85 if (c >=
'0' && c <=
'9') {
87 parserbuf[*parserbuf_index] = c;
90 }
else if (c ==
'.') {
92 parserbuf[*parserbuf_index] = c;
102 if (c >=
'0' && c <=
'9') {
104 parserbuf[*parserbuf_index] = c;
105 (*parserbuf_index)++;
114 if (c >=
'0' && c <=
'9') {
116 parserbuf[*parserbuf_index] = c;
117 (*parserbuf_index)++;
137 parserbuf[*parserbuf_index] =
'\0';
138 *dist = strtod(parserbuf, &end);
140 *parserbuf_index = 0;
151 printf(
"state: SF0X_PARSE_STATE%s\n",
parser_state[*state]);
int sf0x_parser(char c, char *parserbuf, unsigned *parserbuf_index, enum SF0X_PARSE_STATE *state, float *dist)
static crsf_parser_state_t parser_state