Specifications

/* If set the buffer is set to refill */
if(first){
/* If the buffer is full again */
if(buffer_in > (BUFFER_SIZE - 3000)){
/* Start the decoder receiving data again */
tx_act = 1;
SIG_INTERRUPT6();
first = 0;
}
}
/* The buffer has emptied */
if(empty){
empty = 0;
tx_act = 0;
/* Signal to refill buffer */
first = 1;
/* Reset the decoder */
VsReset(0);
}
/*
* Recieve buffer full wait for VSLI to take data
*/
while((BUFFER_SIZE - buffer_in) < 2000 ){
/* 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);
}
/*
* exit if discard has be set
* means a button has been pressed
*/
if (discard){
tx_ptr = mem_start;
wr_ptr = mem_start;
mem_flip = mem_end;
break;
}
}
}
/*
* Close socket.
*/
NutTcpCloseSocket(sock);
}
}
79