#ifdef LOCAL
#define EXTERN
#else
#define EXTERN extern
#endif

void init_uart(void);

#define ESC 0x1b
#define QUEUE_SZ  128 // Must be on a nice binary boundary!
#define FOSC 8000000UL
#define BAUD 9600UL
//#define MYUBRR FOSC/(16*BAUD)-1
#define MYUBRR (FOSC/(16*BAUD)-1)
#define QUEUE_MASK (QUEUE_SZ - 1)

EXTERN unsigned char UART_buffer[QUEUE_SZ];
EXTERN unsigned int  head_cnt, tail_cnt;

