|
@@ -185,7 +185,7 @@ void* belysning_control_thread(void*){
|
|
|
int sem_try=0;
|
|
|
bool activate=false;
|
|
|
bool prolong=false;
|
|
|
- if (clock_gettime(CLOCK_REALTIME, &ts) == -1)
|
|
|
+ if (clock_gettime(CLOCK_REALTIME, &ts) == -1 && tui)
|
|
|
printf("clock_gettime");
|
|
|
ts.tv_sec +=1;
|
|
|
sem_try = sem_timedwait(&mutex_sem, &ts);
|
|
@@ -206,6 +206,7 @@ void* belysning_control_thread(void*){
|
|
|
sem_post(&spooler_sem);
|
|
|
}
|
|
|
//printf("DATA %u, %ld, %ld, %ld %u\n",sq_status,sq_start_time,audio_start_time,tv.tv_sec,prolong);
|
|
|
+ //Check if we should start
|
|
|
if (sq_status == true && sq_start_time+bel_open_time < tv.tv_sec && audio_start_time+bel_open_time < tv.tv_sec){
|
|
|
sq_start_time=sq_start_time;
|
|
|
sq_stop_time=sq_stop_time;
|
|
@@ -217,21 +218,24 @@ void* belysning_control_thread(void*){
|
|
|
start_time=tv.tv_sec;
|
|
|
stop_time=tv.tv_sec+bel_start_on_time;
|
|
|
active=true;
|
|
|
- printf("Start\n");
|
|
|
+ if (tui)
|
|
|
+ printf("Start\n");
|
|
|
|
|
|
}
|
|
|
// Prolong
|
|
|
if (active==true && prolong==true){
|
|
|
if (tv.tv_sec+10 >= stop_time){
|
|
|
stop_time=tv.tv_sec+bel_prolong_time;
|
|
|
- printf("Prolong %u\n",bel_prolong_time);
|
|
|
+ if (tui)
|
|
|
+ printf("Prolong %u\n",bel_prolong_time);
|
|
|
prolong = false;
|
|
|
}
|
|
|
}
|
|
|
if (stop_time<=tv.tv_sec && active){
|
|
|
active=false;
|
|
|
start_time=start_time;
|
|
|
- printf("Stop\n");
|
|
|
+ if (tui)
|
|
|
+ printf("Stop\n");
|
|
|
}
|
|
|
if (active)
|
|
|
if ((stop_time<tv.tv_sec+bel_blink_time) && tv.tv_sec % 2 && bel_blink_time ){
|
|
@@ -752,7 +756,7 @@ void* demodulate(void* params) {
|
|
|
afc.finalize(dev, i, demod_params->fftout);
|
|
|
#endif /* WITH_BCM_VC */
|
|
|
|
|
|
- if (tui) {
|
|
|
+ if (tui || 1==1) {
|
|
|
char symbol = fparms->squelch.signal_outside_filter() ? '~' : (char)channel->axcindicate;
|
|
|
if (dev->mode == R_SCAN) {
|
|
|
//GOTOXY(0, device_num * 17 + dev->row + 3);
|
|
@@ -1214,7 +1218,7 @@ int main(int argc, char* argv[]) {
|
|
|
log(LOG_ERR, "%d device(s) failed to initialize - aborting\n", device_count - devices_running);
|
|
|
error();
|
|
|
}
|
|
|
- if (tui) {
|
|
|
+ if (tui && 1==0) { //PMPMPM
|
|
|
printf("\e[1;1H\e[2J");
|
|
|
|
|
|
GOTOXY(0, 0);
|