buffer.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef BUFFER_H
  2. #define BUFFER_H
  3. #include <rtthread.h>
  4. #include "ring_buffer.h"
  5. #include <stdint.h>
  6. extern ring_buffer *rb_usart1,*rb_usart2,*rb_usart3,*rb_uart4,*rb_uart5;
  7. extern uint8_t usart1_send_data[64];
  8. extern uint8_t usart2_send_data[256];
  9. extern uint8_t usart3_send_data[64];
  10. extern uint8_t uart4_send_data[256];
  11. extern uint8_t flag_uart1_send;
  12. extern uint8_t flag_uart2_send;
  13. extern uint8_t flag_uart3_send;
  14. extern uint8_t flag_uart4_send;
  15. extern ring_buffer *SendWeightQueue,*XbeeQueue,*XbeeAPIQueue,*RemoteQueue;
  16. extern ring_buffer *RecWeightQueue;
  17. extern unsigned char Rec_watchTag_point; //接收标签
  18. extern unsigned char ReadTag_state; //读标签状态 0 没读或已读成功,1 开始读 ,2 正在读
  19. extern unsigned char WriteTag_state; //写标签状态 0 没写或已写成功,1 开始写 ,2 正在写
  20. extern void WriteTag(void);
  21. extern void ReadTag(unsigned char x);
  22. extern uint8_t XbeeConst_CenterAddress[8]; //开始地址 0xFF
  23. extern uint8_t XbeeConst_CCAddress[8]; //开始地址 0xFF
  24. extern uint8_t XbeeConst_RemoteAddress;
  25. extern unsigned char ccsend;
  26. extern unsigned char XbeeConst_FRemoteTxBuf[];
  27. extern unsigned char XbeeConst_FTxBuf0[50]; //处理发送无线临时表
  28. extern unsigned char XbeeConst_FTxBuf0[50];
  29. extern unsigned char* XbeeConst_PTxBuf0;
  30. extern unsigned char* XbeeConst_PRemoteTxBuf0; //处理发送远程显示临时表
  31. extern unsigned char XbeeConst_FrameNumLast;
  32. extern rt_sem_t thread_EmptyBuffer_sem;
  33. extern rt_sem_t uart1_lock;
  34. extern rt_sem_t uart2_lock;
  35. extern rt_sem_t uart3_lock;
  36. extern rt_sem_t uart4_lock;
  37. extern rt_sem_t uart5_lock;
  38. extern void USART_Push(unsigned char address, unsigned char data);
  39. extern void RB_init(void);
  40. extern void threadUart_init(void);
  41. extern unsigned char* BleApp2MakeFrame(unsigned short dist,unsigned char cmd,unsigned char type,unsigned char* buf);//返回一个处理完成后的数组的首地址
  42. extern void threadUart5_init(void);
  43. #endif