From: zer0 Date: Sun, 9 May 2010 14:24:01 +0000 (+0200) Subject: bad trajectory workaround X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=aa1ec78cadb05a26d91acb93f96ccbdf681e2ba5;p=aversive.git bad trajectory workaround --- diff --git a/modules/devices/robot/trajectory_manager/trajectory_manager_core.c b/modules/devices/robot/trajectory_manager/trajectory_manager_core.c index e3311a9..6b3c172 100644 --- a/modules/devices/robot/trajectory_manager/trajectory_manager_core.c +++ b/modules/devices/robot/trajectory_manager/trajectory_manager_core.c @@ -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 */