Swap_data_function
Swap_data_function
uint32_t length;
uint8_t * base;
uint8_t * head;
} LIFO_Buf_t;
return LB_NULL;
else {
return LB_NOT_FULL;
Reflect
Correction:
This buffer shows that it will add the item in before it adjusts the pointer. Instead to be consistent with
our definition of CB_Is_Buf_Full(), the line that adds the item in should come after the check for the
head pointer. In this corrected definition, the head always tracks the last added item, where in the slides
it tracks the next available spot.
return CB_NULL;
}
/* Checks if the buffer is Full */
if ( CB_Is_Buf_Full(lbuf) == CB_FULL ){
return CB_FULL;
cbuf->head = cbuf->base;
else {
cbuf->head++;
*cbuf->head = item;
return CB_NO_ERROR;
}
Play
Volume
6:51
7:22
Autoplay is on
Subtitles
Settings