diff options
-rw-r--r-- | lora_pkt_fwd/src/lora_pkt_fwd.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lora_pkt_fwd/src/lora_pkt_fwd.c b/lora_pkt_fwd/src/lora_pkt_fwd.c index 5aae335..6e0ef35 100644 --- a/lora_pkt_fwd/src/lora_pkt_fwd.c +++ b/lora_pkt_fwd/src/lora_pkt_fwd.c @@ -1579,11 +1579,12 @@ int main(int argc, char** argv) MSG("ERROR: [main] impossible to create GPS thread\n"); exit(EXIT_FAILURE); } - i = pthread_create( &thrid_valid, NULL, (void * (*)(void *))thread_valid, NULL); - if (i != 0) { - MSG("ERROR: [main] impossible to create validation thread\n"); - exit(EXIT_FAILURE); - } + } + + i = pthread_create( &thrid_valid, NULL, (void * (*)(void *))thread_valid, NULL); + if (i != 0) { + MSG("ERROR: [main] impossible to create validation thread\n"); + exit(EXIT_FAILURE); } i = pthread_create( &thrid_spectralscan, NULL, (void * (*)(void *))thread_spectralscan, NULL); @@ -3360,6 +3361,10 @@ void thread_valid(void) { last = now; } + + if (gps_enabled != true) { + continue; + } /* calculate when the time reference was last updated */ pthread_mutex_lock(&mx_timeref); |