#ifndef BUFFER_H
#define BUFFER_H
#include <rtthread.h>
#include "ring_buffer.h"
#include <stdint.h>

extern ring_buffer *rb_usart1,*rb_usart2,*rb_usart3,*rb_uart4,*rb_uart5;
extern uint8_t usart1_send_data[64];
extern uint8_t usart2_send_data[256];
extern uint8_t usart3_send_data[64];
extern uint8_t uart4_send_data[256];
extern uint8_t flag_uart1_send;
extern uint8_t flag_uart2_send;
extern uint8_t flag_uart3_send;
extern uint8_t flag_uart4_send;
extern ring_buffer *SendWeightQueue,*XbeeQueue,*XbeeAPIQueue,*RemoteQueue;
extern ring_buffer *RecWeightQueue;

extern uint8_t XbeeConst_CenterAddress[8];  //开始地址 0xFF
extern uint8_t XbeeConst_CCAddress[8];      //开始地址 0xFF    
extern uint8_t XbeeConst_RemoteAddress;
extern unsigned char ccsend;

extern unsigned char XbeeConst_FRemoteTxBuf[];
extern unsigned char XbeeConst_FTxBuf0[50];        //处理发送无线临时表

extern unsigned char XbeeConst_FTxBuf0[50];
extern unsigned char* XbeeConst_PTxBuf0;
extern unsigned char XbeeConst_FrameNumLast;

extern rt_sem_t thread_EmptyBuffer_sem;

extern rt_sem_t uart1_lock;
extern rt_sem_t uart2_lock;
extern rt_sem_t uart3_lock;
extern rt_sem_t uart4_lock;
extern rt_sem_t uart5_lock;

extern void USART_Push(unsigned char address, unsigned char data);
extern void RB_init(void);
extern void threadUart_init(void);
#endif
