From aa1ec78cadb05a26d91acb93f96ccbdf681e2ba5 Mon Sep 17 00:00:00 2001 From: zer0 Date: Sun, 9 May 2010 16:24:01 +0200 Subject: [PATCH] bad trajectory workaround --- .../trajectory_manager_core.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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 */ -- 2.39.5