Per Mårtensson 3 сар өмнө
parent
commit
65112ef307
1 өөрчлөгдсөн 7 нэмэгдсэн , 4 устгасан
  1. 7 4
      src/rtl_airband.cpp

+ 7 - 4
src/rtl_airband.cpp

@@ -204,7 +204,7 @@ void* belysning_control_thread(void*){
             prolong = true;
             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){
             sq_start_time=sq_start_time;
             sq_stop_time=sq_stop_time;
@@ -216,14 +216,14 @@ void* belysning_control_thread(void*){
             start_time=tv.tv_sec;
             stop_time=tv.tv_sec+START_ON_TIME;
             active=true;
-            printf("start\n");
+            printf("Start\n");
 
         }
         // prolong
         if (active==true && prolong==true){
             if (tv.tv_sec+10 >= stop_time){
                 stop_time=tv.tv_sec+PROLONG_TIME;
-                printf("prolong\n");
+                printf("Prolong\n");
                 prolong = false;
             }
         }
@@ -233,7 +233,10 @@ void* belysning_control_thread(void*){
             printf("Stop\n");
         }
         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
             gpiod_line_set_value(gpio26line, 0);  
     }