while(1)
{
CheckButtons();
OSDelay(50);
}
void delay_polling_task()
{
while(1)
{
CheckEnv();
SetFlags();
OSDelay(1);
}
}
bool isRunning = true;
while(1)
{
OSSemPend(GoSem);
while(isRunning)
{
PlayMusic();
}
}