Specifications
/* Reset the decoder */
VsReset(0);
discard = 0;
/*
* Place the transmit pointer to
* the byte after GAP
*/
tx_ptr = wr_ptr + buffer_shuffle + 4;
/*
* Place the recieve pointer to
* the end of the data recieved
*/
wr_ptr = wr_ptr + bytes;
mem_flip = mem_end;
/* Tell it to refill the buffer */
first = 1;
empty = 0;
break;
}
}
}
buffer_count--;
buffer_shuffle++;
}
/* If no GAP recieved clear the buffer */
if(buffer_count == 0){
tx_ptr = mem_start;
wr_ptr = mem_start;
mem_flip = mem_end;
}
} else {
/*
* If discard is not set move
* the receive pointer to the
* end of the data received
*/
wr_ptr += bytes;
}
/* Chech to see if at the end of the buffer space */
if(wr_ptr > (mem_end - 1500)){
/* Set the flip possition to be used by the tx pointer */
mem_flip = (wr_ptr - 1);
/* set the recieve pointer back to the beginning */
wr_ptr = mem_start;
}
/* Calculate the buffer size */
if (wr_ptr >= tx_ptr){
buffer_in = wr_ptr-tx_ptr;
} else {
buffer_in = (wr_ptr-mem_start)+(mem_flip-tx_ptr);
}
78










