WIP on new faup1090 output, data aging, refactoring

This commit is contained in:
Oliver Jowett 2017-12-02 17:38:33 +00:00
parent a3cdd47d80
commit 6986b3847f
13 changed files with 335 additions and 455 deletions

7
util.c
View file

@ -52,6 +52,8 @@
#include <stdlib.h>
#include <sys/time.h>
uint64_t _messageNow = 0;
uint64_t mstime(void)
{
struct timeval tv;
@ -68,6 +70,11 @@ int64_t receiveclock_ns_elapsed(uint64_t t1, uint64_t t2)
return (t2 - t1) * 1000U / 12U;
}
int64_t receiveclock_ms_elapsed(uint64_t t1, uint64_t t2)
{
return (t2 - t1) / 12000U;
}
void normalize_timespec(struct timespec *ts)
{
if (ts->tv_nsec > 1000000000) {