summaryrefslogtreecommitdiff
path: root/lora_pkt_fwd
diff options
context:
space:
mode:
authorJason Reiss <jreiss@multitech.com>2020-04-06 14:16:55 -0500
committerJason Reiss <jreiss@multitech.com>2020-04-06 14:16:55 -0500
commitd63925da696b9b2238c5a72790819f63455b27d1 (patch)
tree5d06752082f09000ba8d5f3d8888306e44441a11 /lora_pkt_fwd
parent073a0f0f6382f00e4a4cb6c9d6f0f82eaed62bbf (diff)
downloadpacket_forwarder_mtac_full-d63925da696b9b2238c5a72790819f63455b27d1.tar.gz
packet_forwarder_mtac_full-d63925da696b9b2238c5a72790819f63455b27d1.tar.bz2
packet_forwarder_mtac_full-d63925da696b9b2238c5a72790819f63455b27d1.zip
Update lora_pkt_fwd.c
-- start thread_valid and add check for gps_enabled to update time-on-air allowed when gps is off
Diffstat (limited to 'lora_pkt_fwd')
-rw-r--r--lora_pkt_fwd/src/lora_pkt_fwd.c15
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);