![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
ring_buffer.h@105:a930035b6556, 2015-03-10 (annotated)
- Committer:
- klauss
- Date:
- Tue Mar 10 18:10:57 2015 +0000
- Revision:
- 105:a930035b6556
- Parent:
- 100:09a23fcd3bdf
- Child:
- 109:a5b8264ffbbc
sprint 0;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 72:895ca792c647 | 1 | #ifndef __RING_BUFFER_H__ |
klauss | 72:895ca792c647 | 2 | #define __RING_BUFFER_H__ |
klauss | 72:895ca792c647 | 3 | |
klauss | 74:81c47fff88a5 | 4 | #include <assert.h> // for unit_test |
klauss | 74:81c47fff88a5 | 5 | #include <stdint.h> // for uint8* |
klauss | 74:81c47fff88a5 | 6 | #include <stdlib.h> // for NULL ... |
klauss | 105:a930035b6556 | 7 | #include "vz_protocol.h" // for CB_BUFFER_SIZE |
klauss | 72:895ca792c647 | 8 | |
klauss | 100:09a23fcd3bdf | 9 | #define RING_BUFFER_SIZE 5 |
klauss | 72:895ca792c647 | 10 | |
klauss | 72:895ca792c647 | 11 | typedef struct{ |
klauss | 72:895ca792c647 | 12 | uint8_t size; |
klauss | 72:895ca792c647 | 13 | uint8_t begin; |
klauss | 72:895ca792c647 | 14 | uint8_t end; |
klauss | 72:895ca792c647 | 15 | uint8_t * data; |
klauss | 72:895ca792c647 | 16 | }ring_buffer; |
klauss | 72:895ca792c647 | 17 | |
klauss | 72:895ca792c647 | 18 | //FIXME essa funcao deve ser a xmemcpy |
klauss | 72:895ca792c647 | 19 | void rb_xmemcpy(uint8_t * dest, uint8_t * src, uint16_t size); |
klauss | 72:895ca792c647 | 20 | |
klauss | 72:895ca792c647 | 21 | ring_buffer * ring_buffer_init( ring_buffer * rb ); |
klauss | 72:895ca792c647 | 22 | |
klauss | 72:895ca792c647 | 23 | void ring_buffer_delete( ring_buffer **rb ); |
klauss | 72:895ca792c647 | 24 | |
klauss | 72:895ca792c647 | 25 | uint8_t ring_buffer_add( ring_buffer * rb, uint8_t * data ); |
klauss | 72:895ca792c647 | 26 | |
klauss | 72:895ca792c647 | 27 | uint8_t * ring_buffer_get_next( ring_buffer * rb ); |
klauss | 72:895ca792c647 | 28 | |
klauss | 72:895ca792c647 | 29 | #endif |