![](/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
rtpbuf.cpp@137:32dd35a6dbc9, 2015-11-24 (annotated)
- Committer:
- klauss
- Date:
- Tue Nov 24 14:06:22 2015 +0000
- Revision:
- 137:32dd35a6dbc9
- Parent:
- 121:ee02790d00b7
core source of the .bin (09/21/2015) in the field
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 0:4d17cd9c8f9d | 1 | #include "rtpbuf.h" |
klauss | 0:4d17cd9c8f9d | 2 | |
klauss | 0:4d17cd9c8f9d | 3 | void rtpbuf_clear (rtpbuf_t * self) { |
klauss | 0:4d17cd9c8f9d | 4 | self->size = 0; |
klauss | 0:4d17cd9c8f9d | 5 | } |
klauss | 0:4d17cd9c8f9d | 6 | |
klauss | 0:4d17cd9c8f9d | 7 | void rtpbuf_put (rtpbuf_t * self, int size, uint8_t * data){ |
klauss | 0:4d17cd9c8f9d | 8 | if ((size + self->size) <= RTPBUF_BUFSIZE){ |
klauss | 0:4d17cd9c8f9d | 9 | xmemcpy((uint8_t*)self->b+self->size,data,size); |
klauss | 0:4d17cd9c8f9d | 10 | self->size += size; |
klauss | 0:4d17cd9c8f9d | 11 | } |
klauss | 0:4d17cd9c8f9d | 12 | } |
klauss | 0:4d17cd9c8f9d | 13 | |
klauss | 0:4d17cd9c8f9d | 14 | uint8_t * rtpbuf_get (rtpbuf_t * self) { |
klauss | 119:ee6a53069455 | 15 | if (self->size < RTPBUF_PKGSIZE) { return NULL; } |
klauss | 119:ee6a53069455 | 16 | |
klauss | 0:4d17cd9c8f9d | 17 | return (uint8_t*) self->b; |
klauss | 0:4d17cd9c8f9d | 18 | } |
klauss | 0:4d17cd9c8f9d | 19 | |
klauss | 0:4d17cd9c8f9d | 20 | void rtpbuf_next (rtpbuf_t * self) { |
klauss | 119:ee6a53069455 | 21 | if (self->size >= RTPBUF_PKGSIZE){ |
klauss | 0:4d17cd9c8f9d | 22 | self->size -= RTPBUF_PKGSIZE; |
klauss | 0:4d17cd9c8f9d | 23 | if (self->size > 0) { |
klauss | 0:4d17cd9c8f9d | 24 | xmemcpy32(self->b, (self->b)+(RTPBUF_PKGSIZE>>2), self->size); |
klauss | 0:4d17cd9c8f9d | 25 | } |
klauss | 0:4d17cd9c8f9d | 26 | } |
klauss | 0:4d17cd9c8f9d | 27 | } |