#define rts_assert() *(rts_pin+8) = rts_mask; | #define rts_assert() *(rts_pin+8) = rts_mask; | ||||
#define rts_deassert() *(rts_pin+4) = rts_mask; | #define rts_deassert() *(rts_pin+4) = rts_mask; | ||||
#endif | #endif | ||||
#if SERIAL1_TX_BUFFER_SIZE > 255 | |||||
#if SERIAL1_TX_BUFFER_SIZE > 65535 | |||||
static volatile uint32_t tx_buffer_head = 0; | |||||
static volatile uint32_t tx_buffer_tail = 0; | |||||
#elif SERIAL1_TX_BUFFER_SIZE > 255 | |||||
static volatile uint16_t tx_buffer_head = 0; | static volatile uint16_t tx_buffer_head = 0; | ||||
static volatile uint16_t tx_buffer_tail = 0; | static volatile uint16_t tx_buffer_tail = 0; | ||||
#else | #else | ||||
static volatile uint8_t tx_buffer_head = 0; | static volatile uint8_t tx_buffer_head = 0; | ||||
static volatile uint8_t tx_buffer_tail = 0; | static volatile uint8_t tx_buffer_tail = 0; | ||||
#endif | #endif | ||||
#if SERIAL1_RX_BUFFER_SIZE > 255 | |||||
#if SERIAL1_RX_BUFFER_SIZE > 65535 | |||||
static volatile uint32_t rx_buffer_head = 0; | |||||
static volatile uint32_t rx_buffer_tail = 0; | |||||
#elif SERIAL1_RX_BUFFER_SIZE > 255 | |||||
static volatile uint16_t rx_buffer_head = 0; | static volatile uint16_t rx_buffer_head = 0; | ||||
static volatile uint16_t rx_buffer_tail = 0; | static volatile uint16_t rx_buffer_tail = 0; | ||||
#else | #else |
#define rts_assert() *(rts_pin+8) = rts_mask; | #define rts_assert() *(rts_pin+8) = rts_mask; | ||||
#define rts_deassert() *(rts_pin+4) = rts_mask; | #define rts_deassert() *(rts_pin+4) = rts_mask; | ||||
#endif | #endif | ||||
#if SERIAL2_TX_BUFFER_SIZE > 255 | |||||
#if SERIAL2_TX_BUFFER_SIZE > 65535 | |||||
static volatile uint32_t tx_buffer_head = 0; | |||||
static volatile uint32_t tx_buffer_tail = 0; | |||||
#elif SERIAL2_TX_BUFFER_SIZE > 255 | |||||
static volatile uint16_t tx_buffer_head = 0; | static volatile uint16_t tx_buffer_head = 0; | ||||
static volatile uint16_t tx_buffer_tail = 0; | static volatile uint16_t tx_buffer_tail = 0; | ||||
#else | #else | ||||
static volatile uint8_t tx_buffer_head = 0; | static volatile uint8_t tx_buffer_head = 0; | ||||
static volatile uint8_t tx_buffer_tail = 0; | static volatile uint8_t tx_buffer_tail = 0; | ||||
#endif | #endif | ||||
#if SERIAL2_RX_BUFFER_SIZE > 255 | |||||
#if SERIAL2_RX_BUFFER_SIZE > 65535 | |||||
static volatile uint32_t rx_buffer_head = 0; | |||||
static volatile uint32_t rx_buffer_tail = 0; | |||||
#elif SERIAL2_RX_BUFFER_SIZE > 255 | |||||
static volatile uint16_t rx_buffer_head = 0; | static volatile uint16_t rx_buffer_head = 0; | ||||
static volatile uint16_t rx_buffer_tail = 0; | static volatile uint16_t rx_buffer_tail = 0; | ||||
#else | #else |
#define rts_assert() *(rts_pin+8) = rts_mask; | #define rts_assert() *(rts_pin+8) = rts_mask; | ||||
#define rts_deassert() *(rts_pin+4) = rts_mask; | #define rts_deassert() *(rts_pin+4) = rts_mask; | ||||
#endif | #endif | ||||
#if SERIAL3_TX_BUFFER_SIZE > 255 | |||||
#if SERIAL3_TX_BUFFER_SIZE > 65535 | |||||
static volatile uint32_t tx_buffer_head = 0; | |||||
static volatile uint32_t tx_buffer_tail = 0; | |||||
#elif SERIAL3_TX_BUFFER_SIZE > 255 | |||||
static volatile uint16_t tx_buffer_head = 0; | static volatile uint16_t tx_buffer_head = 0; | ||||
static volatile uint16_t tx_buffer_tail = 0; | static volatile uint16_t tx_buffer_tail = 0; | ||||
#else | #else | ||||
static volatile uint8_t tx_buffer_head = 0; | static volatile uint8_t tx_buffer_head = 0; | ||||
static volatile uint8_t tx_buffer_tail = 0; | static volatile uint8_t tx_buffer_tail = 0; | ||||
#endif | #endif | ||||
#if SERIAL3_RX_BUFFER_SIZE > 255 | |||||
#if SERIAL3_RX_BUFFER_SIZE > 65535 | |||||
static volatile uint32_t rx_buffer_head = 0; | |||||
static volatile uint32_t rx_buffer_tail = 0; | |||||
#elif SERIAL3_RX_BUFFER_SIZE > 255 | |||||
static volatile uint16_t rx_buffer_head = 0; | static volatile uint16_t rx_buffer_head = 0; | ||||
static volatile uint16_t rx_buffer_tail = 0; | static volatile uint16_t rx_buffer_tail = 0; | ||||
#else | #else |
static volatile uint8_t *rts_pin=NULL; | static volatile uint8_t *rts_pin=NULL; | ||||
#define rts_assert() *rts_pin = 0 | #define rts_assert() *rts_pin = 0 | ||||
#define rts_deassert() *rts_pin = 1 | #define rts_deassert() *rts_pin = 1 | ||||
#if SERIAL4_TX_BUFFER_SIZE > 255 | |||||
#if SERIAL4_TX_BUFFER_SIZE > 65535 | |||||
static volatile uint32_t tx_buffer_head = 0; | |||||
static volatile uint32_t tx_buffer_tail = 0; | |||||
#elif SERIAL4_TX_BUFFER_SIZE > 255 | |||||
static volatile uint16_t tx_buffer_head = 0; | static volatile uint16_t tx_buffer_head = 0; | ||||
static volatile uint16_t tx_buffer_tail = 0; | static volatile uint16_t tx_buffer_tail = 0; | ||||
#else | #else | ||||
static volatile uint8_t tx_buffer_head = 0; | static volatile uint8_t tx_buffer_head = 0; | ||||
static volatile uint8_t tx_buffer_tail = 0; | static volatile uint8_t tx_buffer_tail = 0; | ||||
#endif | #endif | ||||
#if SERIAL4_RX_BUFFER_SIZE > 255 | |||||
#if SERIAL4_RX_BUFFER_SIZE > 65535 | |||||
static volatile uint32_t rx_buffer_head = 0; | |||||
static volatile uint32_t rx_buffer_tail = 0; | |||||
#elif SERIAL4_RX_BUFFER_SIZE > 255 | |||||
static volatile uint16_t rx_buffer_head = 0; | static volatile uint16_t rx_buffer_head = 0; | ||||
static volatile uint16_t rx_buffer_tail = 0; | static volatile uint16_t rx_buffer_tail = 0; | ||||
#else | #else |
static volatile uint8_t *rts_pin=NULL; | static volatile uint8_t *rts_pin=NULL; | ||||
#define rts_assert() *rts_pin = 0 | #define rts_assert() *rts_pin = 0 | ||||
#define rts_deassert() *rts_pin = 1 | #define rts_deassert() *rts_pin = 1 | ||||
#if SERIAL5_TX_BUFFER_SIZE > 255 | |||||
#if SERIAL5_TX_BUFFER_SIZE > 65535 | |||||
static volatile uint32_t tx_buffer_head = 0; | |||||
static volatile uint32_t tx_buffer_tail = 0; | |||||
#elif SERIAL5_TX_BUFFER_SIZE > 255 | |||||
static volatile uint16_t tx_buffer_head = 0; | static volatile uint16_t tx_buffer_head = 0; | ||||
static volatile uint16_t tx_buffer_tail = 0; | static volatile uint16_t tx_buffer_tail = 0; | ||||
#else | #else | ||||
static volatile uint8_t tx_buffer_head = 0; | static volatile uint8_t tx_buffer_head = 0; | ||||
static volatile uint8_t tx_buffer_tail = 0; | static volatile uint8_t tx_buffer_tail = 0; | ||||
#endif | #endif | ||||
#if SERIAL5_RX_BUFFER_SIZE > 255 | |||||
#if SERIAL5_RX_BUFFER_SIZE > 65535 | |||||
static volatile uint32_t rx_buffer_head = 0; | |||||
static volatile uint32_t rx_buffer_tail = 0; | |||||
#elif SERIAL5_RX_BUFFER_SIZE > 255 | |||||
static volatile uint16_t rx_buffer_head = 0; | static volatile uint16_t rx_buffer_head = 0; | ||||
static volatile uint16_t rx_buffer_tail = 0; | static volatile uint16_t rx_buffer_tail = 0; | ||||
#else | #else |
static volatile uint8_t *rts_pin=NULL; | static volatile uint8_t *rts_pin=NULL; | ||||
#define rts_assert() *rts_pin = 0 | #define rts_assert() *rts_pin = 0 | ||||
#define rts_deassert() *rts_pin = 1 | #define rts_deassert() *rts_pin = 1 | ||||
#if SERIAL6_TX_BUFFER_SIZE > 255 | |||||
#if SERIAL6_TX_BUFFER_SIZE > 65535 | |||||
static volatile uint32_t tx_buffer_head = 0; | |||||
static volatile uint32_t tx_buffer_tail = 0; | |||||
#elif SERIAL6_TX_BUFFER_SIZE > 255 | |||||
static volatile uint16_t tx_buffer_head = 0; | static volatile uint16_t tx_buffer_head = 0; | ||||
static volatile uint16_t tx_buffer_tail = 0; | static volatile uint16_t tx_buffer_tail = 0; | ||||
#else | #else | ||||
static volatile uint8_t tx_buffer_head = 0; | static volatile uint8_t tx_buffer_head = 0; | ||||
static volatile uint8_t tx_buffer_tail = 0; | static volatile uint8_t tx_buffer_tail = 0; | ||||
#endif | #endif | ||||
#if SERIAL6_RX_BUFFER_SIZE > 255 | |||||
#if SERIAL6_RX_BUFFER_SIZE > 65535 | |||||
static volatile uint32_t rx_buffer_head = 0; | |||||
static volatile uint32_t rx_buffer_tail = 0; | |||||
#elif SERIAL6_RX_BUFFER_SIZE > 255 | |||||
static volatile uint16_t rx_buffer_head = 0; | static volatile uint16_t rx_buffer_head = 0; | ||||
static volatile uint16_t rx_buffer_tail = 0; | static volatile uint16_t rx_buffer_tail = 0; | ||||
#else | #else |