34 #include "pprzlink/messages.h"
42 #define OTF_UNINIT 0x00
43 #define OTF_WAIT_START OTF_UNINIT
44 #define OTF_WAIT_COUNTER 0x01
45 #define OTF_WAIT_ANGLES 0x02
46 #define OTF_WAIT_ALTITUDE 0x03
47 #define OTF_WAIT_CHECKSUM 0x04
49 #define OTF_START 0x0A
50 #define OTF_LIMITER ','
55 void *
_sbrk(
int a __attribute__((unused))) {
return 0;}
61 static char otf_inp[64];
79 if (isdigit((
int)c)) {
83 otf_inp[otf_idx++] = c;
98 if (isdigit((
int)c) || (c ==
'-') || (c ==
'.')) {
99 otf_inp[otf_idx++] = c;
101 if ((otf_idx > 1) && (otf_idx < 9) && (c ==
OTF_LIMITER)) {
102 otf_inp[otf_idx] = 0;
105 if (otf_crs_idx++ == 2) {
115 if (isdigit((
int)c) || (c ==
'-') || (c ==
'.')) {
116 otf_inp[otf_idx++] = c;
118 if ((otf_idx > 1) && (otf_idx < 9) && (c ==
OTF_LIMITER)) {
119 otf_inp[otf_idx] = 0;
130 if (isxdigit((
int)c)) {
131 otf_inp[otf_idx++] = c;
133 if ((otf_idx == 2) && (c ==
OTF_END)) {
134 otf_inp[otf_idx] = 0;
135 checksum = strtol(otf_inp, NULL, 16);
void airspeed_otf_init(void)
void airspeed_otf_parse(char c)
#define OTF_WAIT_CHECKSUM
void airspeed_otf_periodic(void)
void airspeed_otf_event(void)
#define OTF_WAIT_ALTITUDE
Common code for AP and FBW telemetry.
Device independent serial meteo code.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.