Specifications

static HANDLE q_stop = 0;
static HANDLE q_next = 0;
static HANDLE q_previous = 0;
char button = 0;
char first = 1;
/*
* Pause button ISR
*/
static void PauseButton(void *arg)
{
/*Diable the button interrupt*/
EIMSK = EIMSK & ~(0x01);
/* Toggle the button state */
if(play){
pause = 0;
} else {
pause = 1;
}
if (pause){
/* change mode to play */
play = 1;
/* Send command to the server */
NutTcpSend(command_sock, "UNPAUSE\n", 12);
} else {
/* Send command to the server */
NutTcpSend(command_sock, "PAUSE\n", 12);
/* Disable the encoder access to the buffer */
tx_act = 0;
/* change mode to pause */
play = 0;
/* This will discard all transfer until it recieves GAP */
discard = 1;
}
/* Signal to debounce that a button has been pressed */
button = 1;
/* Return the handler - signals the interrupt is finished */
NutEventPostAsync(&q_pause);
}
/*
* Stop button ISR
*/
static void StopButton(void *arg)
{
/*Diable the button interrupt*/
EIMSK = EIMSK & ~(0x04);
/* Disable the encoder access to the buffer */
tx_act = 0;
/* Send command to the server */
NutTcpSend(command_sock, "STOP\n", 12);
73