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;
void uart_put_byte(struct uart_periph *periph, long fd, uint8_t data)
void uart_periph_set_baudrate(struct uart_periph *periph, uint32_t baud)
#define UART_TX_BUFFER_SIZE
#define UART_RX_BUFFER_SIZE
static const struct usb_device_descriptor dev
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
int WEAK uart_char_available(struct uart_periph *p)
Check UART for available chars in receive buffer.
static void send_uart_err(struct transport_tx *trans, struct link_device *dev)
void WEAK uart_send_message(struct uart_periph *p, long fd)
void uart_periph_init(struct uart_periph *p)
void WEAK uart_put_buffer(struct uart_periph *p, long fd, const uint8_t *data, uint16_t len)
void WEAK uart_periph_invert_data_logic(struct uart_periph *p, bool invert_rx, bool invert_tx)
int WEAK uart_check_free_space(struct uart_periph *p, long *fd, uint16_t len)
void WEAK uart_arch_init(void)
uint8_t WEAK uart_getch(struct uart_periph *p)
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
volatile uint16_t ne_err
noise error counter
volatile uint16_t fe_err
framing error counter
volatile uint16_t ore
overrun error counter
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.