paparazzi-commits
[Top][All Lists]
Advanced

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

[paparazzi-commits] [4126] bug fix on counter delay


From: Gautier Hattenberger
Subject: [paparazzi-commits] [4126] bug fix on counter delay
Date: Wed, 09 Sep 2009 16:08:43 +0000

Revision: 4126
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=4126
Author:   gautier
Date:     2009-09-09 16:08:43 +0000 (Wed, 09 Sep 2009)
Log Message:
-----------
bug fix on counter delay

Modified Paths:
--------------
    paparazzi3/trunk/sw/airborne/booz/booz2_main.c

Modified: paparazzi3/trunk/sw/airborne/booz/booz2_main.c
===================================================================
--- paparazzi3/trunk/sw/airborne/booz/booz2_main.c      2009-09-09 15:27:19 UTC 
(rev 4125)
+++ paparazzi3/trunk/sw/airborne/booz/booz2_main.c      2009-09-09 16:08:43 UTC 
(rev 4126)
@@ -85,7 +85,10 @@
 }
 #endif /* SITL */
 
+#ifdef BOOZ_START_DELAY
+bool_t delay_done;
 uint32_t init_done_time;
+#endif
 
 STATIC_INLINE void booz2_main_init( void ) {
 
@@ -127,7 +130,10 @@
 
   int_enable();
 
+#ifdef BOOZ_START_DELAY
+  delay_done = FALSE;
   init_done_time = T0TC;
+#endif
 
 }
 
@@ -137,7 +143,10 @@
 
   booz_imu_periodic();
 #ifdef BOOZ_START_DELAY
-  if ((uint32_t)(T0TC-init_done_time) < 
SYS_TICS_OF_USEC((uint32_t)(BOOZ_START_DELAY*1e6))) return;
+  if (!delay_done) {
+    if ((uint32_t)(T0TC-init_done_time) < 
SYS_TICS_OF_USEC((uint32_t)(BOOZ_START_DELAY*1e6))) return;
+    else delay_done = TRUE;
+  }
 #endif
 
   /* run control loops */





reply via email to

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