#include <stdint.h>
#include <stdio.h>
#include "main.h"

// === UART ===
#define RX_CMD_RB_SIZE                  (32)
#define RX_CMD_RB_SIZE_MASK             (RX_CMD_RB_SIZE - 1)

// uartz
extern char uart1_rx_buf[2], uart2_rx_buf[2], uart3_rx_buf[2], rx_cmd_rb[RX_CMD_RB_SIZE];
extern uint8_t rx_cmd_rb_in_idx, rx_cmd_rb_out_idx;

// uartz
extern char uart_rx_buf[2], rx_cmd_rb[RX_CMD_RB_SIZE];
extern uint8_t rx_cmd_rb_in_idx, rx_cmd_rb_out_idx;

void enqueue_cmd(char in);
void enqueue_nmea(char in);

uint16_t ringbuf_increment(uint8_t *index, uint8_t buff_size_mask);
