Prusa3d Marlin fork
rbuf.h
1 //rbuf.h
2 #ifndef _RBUF_H
3 #define _RBUF_H
4 
5 #include <inttypes.h>
6 
7 
8 #define rbuf_l(ptr) (ptr[0])
9 #define rbuf_w(ptr) (ptr[1])
10 #define rbuf_r(ptr) (ptr[2])
11 #define rbuf_empty(ptr) (ptr[1] == ptr[2])
12 
13 
14 #if defined(__cplusplus)
15 extern "C" {
16 #endif //defined(__cplusplus)
17 
18 
19 extern void rbuf_ini(uint8_t* ptr, uint8_t len);
20 extern int rbuf_put(uint8_t* ptr, uint8_t val);
21 extern int rbuf_get(uint8_t* ptr);
22 
23 
24 #if defined(__cplusplus)
25 }
26 #endif //defined(__cplusplus)
27 #endif //_RBUF_H