]> git.droids-corp.org - aversive.git/commitdiff
bad trajectory workaround
authorzer0 <zer0@carbon.local>
Sun, 9 May 2010 14:24:01 +0000 (16:24 +0200)
committerzer0 <zer0@carbon.local>
Sun, 9 May 2010 14:24:01 +0000 (16:24 +0200)
modules/devices/robot/trajectory_manager/trajectory_manager_core.c

index e3311a9007b789cdf90c5b25f53b3b4486926c86..6b3c172967865f91880e4d24d986889f44bb4785 100644 (file)
@@ -319,11 +319,24 @@ uint8_t trajectory_distance_finished(struct trajectory *traj)
 uint8_t trajectory_finished(struct trajectory *traj)
 {
        uint8_t flags, ret;
+       //      uint8_t ret2;
+
        IRQ_LOCK(flags);
-       ret = trajectory_angle_finished(traj) &&
-               trajectory_distance_finished(traj);
+       ret = trajectory_distance_finished(traj) &&
+               trajectory_angle_finished(traj);
        IRQ_UNLOCK(flags);
+
+#if 0
+       /* XXX THIS IS A VERY BAD WORKAROUND (fix a race) */
+       IRQ_LOCK(flags);
+       ret2 = trajectory_distance_finished(traj) &&
+               trajectory_angle_finished(traj);
+       IRQ_UNLOCK(flags);
+
+       return ret && ret2;
+#else
        return ret;
+#endif
 }
 
 /** return true if traj is nearly finished */