paparazzi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paparazzi-commits] [4222] Update onboard logger to start time at 0 inst


From: Allen Ibara
Subject: [paparazzi-commits] [4222] Update onboard logger to start time at 0 instead of absolute time in seconds
Date: Fri, 02 Oct 2009 16:15:06 +0000

Revision: 4222
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=4222
Author:   aibara
Date:     2009-10-02 16:15:02 +0000 (Fri, 02 Oct 2009)
Log Message:
-----------
Update onboard logger to start time at 0 instead of absolute time in seconds

Modified Paths:
--------------
    paparazzi3/trunk/sw/airborne/fms/onboard_logger.c

Modified: paparazzi3/trunk/sw/airborne/fms/onboard_logger.c
===================================================================
--- paparazzi3/trunk/sw/airborne/fms/onboard_logger.c   2009-10-02 15:43:29 UTC 
(rev 4221)
+++ paparazzi3/trunk/sw/airborne/fms/onboard_logger.c   2009-10-02 16:15:02 UTC 
(rev 4222)
@@ -11,7 +11,12 @@
   int i = 0;
   u_char length;
   u_char ck_A = 0, ck_B = 0;
+  static unsigned int start_secs = 0;
 
+  if (start_secs == 0) {
+    start_secs = ts->tv_sec;
+  }
+
   length = buf[i];
 
   for (i = 0; i < length - 3; i++)
@@ -25,7 +30,7 @@
     return;
   }
   //printf("Got pprz msg len %i, ckA %02x, ckB %02x (%02x %02x)\n", length, 
ck_A, ck_B, buf[length - 3], buf[length - 2]);
-  printf("%i.%06i ", (unsigned) ts->tv_sec, (unsigned) ts->tv_usec);
+  printf("%i.%06i ", (unsigned) ts->tv_sec - start_secs, (unsigned) 
ts->tv_usec);
   printf("%i %i ", buf[1], buf[2]);
   for(i = 2; i < length - 3; i++)
   {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]