static volatile bool pwrOn = false;
static volatile bool chnl1 = true;
static volatile bool intro = false;
+static volatile bool delaying = false;
//static volatile bool sthchanged = false;
static pthread_cond_t* wakeup;
static pthread_mutex_t* mut;
}
void pwrBtn(void) {
+ if (delaying) return;
pthread_mutex_lock(mut);
pwrOn = !pwrOn;
if (pwrOn) intro = false;
}
void chnl1Btn(void) {
+ if (delaying) return;
pthread_mutex_lock(mut);
chnl1 = true;
pthread_mutex_unlock(mut);
}
void chnl2Btn(void) {
+ if (delaying) return;
pthread_mutex_lock(mut);
chnl1 = false;
pthread_mutex_unlock(mut);
}
void introBtn(void) {
+ if (delaying) return;
pthread_mutex_lock(mut);
intro = !intro;
pthread_mutex_unlock(mut);
while (running) {
pthread_mutex_lock(mut);
pthread_cond_wait(wakeup, mut);
-
+ delaying = true;
if (playThread) {
pthread_cancel(playThread);
}
}
}
delay(500);
+ delaying = false;
pthread_mutex_unlock(mut);
}