|
@@ -204,7 +204,7 @@ void* belysning_control_thread(void*){
|
|
prolong = true;
|
|
prolong = true;
|
|
sem_post(&spooler_sem);
|
|
sem_post(&spooler_sem);
|
|
}
|
|
}
|
|
- printf("DATA %u, %ld, %ld, %ld %u\n",sq_status,sq_start_time,audio_start_time,tv.tv_sec,prolong);
|
|
|
|
|
|
+ //printf("DATA %u, %ld, %ld, %ld %u\n",sq_status,sq_start_time,audio_start_time,tv.tv_sec,prolong);
|
|
if (sq_status == true && sq_start_time+OPEN_TIME < tv.tv_sec && audio_start_time+OPEN_TIME < tv.tv_sec){
|
|
if (sq_status == true && sq_start_time+OPEN_TIME < tv.tv_sec && audio_start_time+OPEN_TIME < tv.tv_sec){
|
|
sq_start_time=sq_start_time;
|
|
sq_start_time=sq_start_time;
|
|
sq_stop_time=sq_stop_time;
|
|
sq_stop_time=sq_stop_time;
|
|
@@ -216,14 +216,14 @@ void* belysning_control_thread(void*){
|
|
start_time=tv.tv_sec;
|
|
start_time=tv.tv_sec;
|
|
stop_time=tv.tv_sec+START_ON_TIME;
|
|
stop_time=tv.tv_sec+START_ON_TIME;
|
|
active=true;
|
|
active=true;
|
|
- printf("start\n");
|
|
|
|
|
|
+ printf("Start\n");
|
|
|
|
|
|
}
|
|
}
|
|
// prolong
|
|
// prolong
|
|
if (active==true && prolong==true){
|
|
if (active==true && prolong==true){
|
|
if (tv.tv_sec+10 >= stop_time){
|
|
if (tv.tv_sec+10 >= stop_time){
|
|
stop_time=tv.tv_sec+PROLONG_TIME;
|
|
stop_time=tv.tv_sec+PROLONG_TIME;
|
|
- printf("prolong\n");
|
|
|
|
|
|
+ printf("Prolong\n");
|
|
prolong = false;
|
|
prolong = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -233,7 +233,10 @@ void* belysning_control_thread(void*){
|
|
printf("Stop\n");
|
|
printf("Stop\n");
|
|
}
|
|
}
|
|
if (active)
|
|
if (active)
|
|
- gpiod_line_set_value(gpio26line, 1);
|
|
|
|
|
|
+ if ((stop_time<tv.tv_sec+BLINK_TIME) && tv.tv_sec % 2 && BLINK_TIME )
|
|
|
|
+ gpiod_line_set_value(gpio26line, 0);
|
|
|
|
+ else
|
|
|
|
+ gpiod_line_set_value(gpio26line, 1);
|
|
else
|
|
else
|
|
gpiod_line_set_value(gpio26line, 0);
|
|
gpiod_line_set_value(gpio26line, 0);
|
|
}
|
|
}
|