25 #if PERIODIC_TELEMETRY
32 #if PERIODIC_TELEMETRY
33 static void send_uart0_err(
struct transport_tx *trans,
struct link_device *
dev)
39 pprz_msg_send_UART_ERRORS(trans,
dev, AC_ID,
49 #if PERIODIC_TELEMETRY
50 static void send_uart1_err(
struct transport_tx *trans,
struct link_device *
dev)
56 pprz_msg_send_UART_ERRORS(trans,
dev, AC_ID,
66 #if PERIODIC_TELEMETRY
67 static void send_uart2_err(
struct transport_tx *trans,
struct link_device *
dev)
73 pprz_msg_send_UART_ERRORS(trans,
dev, AC_ID,
83 #if PERIODIC_TELEMETRY
84 static void send_uart3_err(
struct transport_tx *trans,
struct link_device *
dev)
90 pprz_msg_send_UART_ERRORS(trans,
dev, AC_ID,
100 #if PERIODIC_TELEMETRY
101 static void send_uart4_err(
struct transport_tx *trans,
struct link_device *
dev)
107 pprz_msg_send_UART_ERRORS(trans,
dev, AC_ID,
117 #if PERIODIC_TELEMETRY
118 static void send_uart5_err(
struct transport_tx *trans,
struct link_device *
dev)
124 pprz_msg_send_UART_ERRORS(trans,
dev, AC_ID,
134 #if PERIODIC_TELEMETRY
135 static void send_uart6_err(
struct transport_tx *trans,
struct link_device *
dev)
141 pprz_msg_send_UART_ERRORS(trans,
dev, AC_ID,
151 #if PERIODIC_TELEMETRY
152 static void send_uart7_err(
struct transport_tx *trans,
struct link_device *
dev)
158 pprz_msg_send_UART_ERRORS(trans,
dev, AC_ID,
167 #if PERIODIC_TELEMETRY
168 static void send_uart8_err(
struct transport_tx *trans,
struct link_device *
dev)
174 pprz_msg_send_UART_ERRORS(trans,
dev, AC_ID,
180 #if PERIODIC_TELEMETRY
181 static void send_uart_err(
struct transport_tx *trans __attribute__ ((unused)),
182 struct link_device *
dev __attribute__ ((unused)))
184 static uint8_t uart_nb_cnt = 0;
185 switch (uart_nb_cnt) {
188 send_uart0_err(trans,
dev);
break;
192 send_uart1_err(trans,
dev);
break;
196 send_uart2_err(trans,
dev);
break;
200 send_uart3_err(trans,
dev);
break;
204 send_uart4_err(trans,
dev);
break;
208 send_uart5_err(trans,
dev);
break;
212 send_uart6_err(trans,
dev);
break;
216 send_uart7_err(trans,
dev);
break;
220 send_uart8_err(trans,
dev);
break;
225 if (uart_nb_cnt == 9) {
233 p->rx_insert_idx = 0;
234 p->rx_extract_idx = 0;
235 p->tx_insert_idx = 0;
236 p->tx_extract_idx = 0;
237 p->tx_running =
false;
241 p->device.periph = (
void *)
p;
250 #if PERIODIC_TELEMETRY
258 int space =
p->tx_extract_idx -
p->tx_insert_idx - 1;
262 return space >= len ? space : 0;
269 for (i = 0; i < len; i++) {
281 uint8_t ret =
p->rx_buf[
p->rx_extract_idx];
288 int available =
p->rx_insert_idx -
p->rx_extract_idx;