strat_set_speed(SPEED_CLITOID_FAST, SPEED_ANGLE_SLOW);
}
- /* XXX check return value !! */
ret = trajectory_clitoid(&mainboard.traj, l1.p1.x, l1.p1.y,
line1_a_deg, 150., diff_a_deg, beta_deg,
radius, xy_norm(l1.p1.x, l1.p1.y,
reprocess:
ret = strat_calc_clitoid(num1, dir1, num2, dir2, &pack_spickles);
- if (ret < 0)
+ if (ret < 0) {
DEBUG(E_USER_STRAT, "clitoid failed");
+ return END_ERROR;
+ }
/* XXX what to do if cobboard is stucked */
num2, dir2),
flags);
+ /* error during traj, or traj finished */
+ if (err != 0)
+ return err;
+
/* the speed has to change */
- if (trajectory_get_state(&mainboard.traj) != RUNNING_CLITOID_CURVE)
+ if (err == 0 &&
+ trajectory_get_state(&mainboard.traj) != RUNNING_CLITOID_CURVE)
goto reprocess;
DEBUG(E_USER_STRAT, "clitoid started err=%d pack_spickles=%d",
err = wait_traj_end(flags);
}
- DEBUG(E_USER_STRAT, "clitoid finished");
-
- /* XXX 600 -> cste */
- /* XXX does not work, do better */
-/* if (err == 0 && d_speed < 600 && */
-/* mainboard.traj.state == RUNNING_CLITOID_LINE) */
-/* strat_set_speed(600, SPEED_ANGLE_FAST); */
+ DEBUG(E_USER_STRAT, "clitoid finished, err=%d", err);
strat_rpack60 = 0;
strat_lpack60 = 0;