summaryrefslogtreecommitdiff
path: root/digital/mimot/src/dirty/twi_proto.c
diff options
context:
space:
mode:
Diffstat (limited to 'digital/mimot/src/dirty/twi_proto.c')
-rw-r--r--digital/mimot/src/dirty/twi_proto.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/digital/mimot/src/dirty/twi_proto.c b/digital/mimot/src/dirty/twi_proto.c
index 5398815f..a61d3d6c 100644
--- a/digital/mimot/src/dirty/twi_proto.c
+++ b/digital/mimot/src/dirty/twi_proto.c
@@ -110,46 +110,48 @@ twi_proto_callback (u8 *buf, u8 size)
/* Reset. */
utils_reset ();
break;
- case c ('b', 3):
+ case c ('b', 4):
/* Move the aux0.
* - w: new position.
- * - b: speed. */
- cs_aux[0].speed.max = buf[4];
+ * - w: speed. */
+ cs_aux[0].speed.max = v8_to_v16 (buf[4], buf[5]);
aux_traj_goto_start (&aux[0], v8_to_v16 (buf[2], buf[3]));
break;
case c ('c', 3):
/* Move the aux1.
* - w: new position.
- * - b: speed. */
- cs_aux[1].speed.max = buf[4];
+ * - w: speed. */
+ cs_aux[1].speed.max = v8_to_v16 (buf[4], buf[5]);
aux_traj_goto_start (&aux[1], v8_to_v16 (buf[2], buf[3]));
break;
- case c ('B', 5):
+ case c ('B', 6):
/* Find the zero position.
* - b: aux index.
- * - b: speed.
+ * - w: speed.
* - b: use switch.
* - w: reset position. */
if (buf[2] < AC_ASSERV_AUX_NB)
{
- if (buf[4])
- aux_traj_find_zero_start (&aux[buf[2]], buf[3],
- v8_to_v16 (buf[5], buf[6]));
+ if (buf[5])
+ aux_traj_find_zero_start (&aux[buf[2]],
+ v8_to_v16 (buf[3], buf[4]),
+ v8_to_v16 (buf[6], buf[7]));
else
- aux_traj_find_limit_start (&aux[buf[2]], buf[3],
- v8_to_v16 (buf[5], buf[6]));
+ aux_traj_find_limit_start (&aux[buf[2]],
+ v8_to_v16 (buf[3], buf[4]),
+ v8_to_v16 (buf[6], buf[7]));
}
else
buf[0] = 0;
break;
- case c ('l', 4):
+ case c ('l', 5):
/* Clamp.
* - b: aux index.
- * - b: speed.
+ * - w: speed.
* - w: claming PWM. */
if (buf[2] < AC_ASSERV_AUX_NB)
- aux_traj_clamp_start (&aux[buf[2]], buf[3],
- v8_to_v16 (buf[4], buf[5]));
+ aux_traj_clamp_start (&aux[buf[2]], v8_to_v16 (buf[3], buf[4]),
+ v8_to_v16 (buf[5], buf[6]));
else
buf[0] = 0;
break;