Specifications

/*
* debounce thread
*/
THREAD(debounce, arg)
{
while(1){
/* Wait for button press */
NutSleep(100);
if (button){
/* Re - enable buttons after 200ms */
NutSleep(200);
EIMSK = EIMSK | 0x0F;
button = 0;
}
}
}
/*
* Command recieving thread
*/
THREAD(Command, arg)
{
char playlist_buff[50];
char size;
/* Change thread priority to the lowest */
NutThreadSetPriority(200);
while(1){
/* Recieve the song name from the server */
size = NutTcpReceive(playlist_sock, &playlist_buff[0], 50);
/* Null terminate */
playlist_buff[size] = NULL;
/* Change thread priority to the highest */
NutThreadSetPriority(10);
/* Print the song name on the LCD */
print_screen(&playlist_buff[0]);
/* Change thread priority back to the lowest */
NutThreadSetPriority(200);
}
}
/*
* Main Thread.
*
75