Sub programs of serial_transport, PID and motor contrl.
Dependents: tracking_ball_0516 tracking_ball_0516
Diff: Circle_Buffer_Class.h
- Revision:
- 7:fd405402ff8c
- Parent:
- 2:a668eb71516b
--- a/Circle_Buffer_Class.h Sat May 29 17:16:49 2021 +0000 +++ b/Circle_Buffer_Class.h Sun May 30 01:39:35 2021 +0000 @@ -2,22 +2,23 @@ #define __CIRCLE_BUFFER_CLASS_H__ #include "mbed.h" -#define RECV_BUFFER_SIZE 100 +#define RECV_BUFFER_SIZE 50 -class Circle_Buffer_Class { +class Circle_Buffer_Class +{ public: - Circle_Buffer_Class(int size); - ~Circle_Buffer_Class(); - unsigned char Write_To(unsigned char infor); - unsigned char Read_From(unsigned char *p); + Circle_Buffer_Class(int size); + ~Circle_Buffer_Class(); + unsigned char Write_To(unsigned char infor); + unsigned char Read_From(unsigned char *p); private: - void Init_Circle_Struct(); - unsigned char * pbuffer; //接收缓存,用于存储接受的数据 - unsigned char Write_Index; //写入位置(缓存区可写入数据的数组位置索性) - unsigned char Read_Index; //读取位置 (缓存区可以待读取数据的数组索引) - unsigned int buffer_size; //缓存区最大长度 - -} ; + void Init_Circle_Struct(); + unsigned char * pbuffer; //接收缓存,用于存储接受的数据 + unsigned char Write_Index; //写入位置(缓存区可写入数据的数组位置索性) + unsigned char Read_Index; //读取位置 (缓存区可以待读取数据的数组索引) + unsigned int buffer_size; //缓存区最大长度 + +} ; #endif \ No newline at end of file