summaryrefslogtreecommitdiff
path: root/n/asserv/src/main.c
diff options
context:
space:
mode:
authorschodet2005-04-16 14:36:22 +0000
committerschodet2005-04-16 14:36:22 +0000
commitb37a11a2f303519ffb59e96dd9a853b1945df45b (patch)
tree38313eacaa9fa653e7d5dd610090de6330801960 /n/asserv/src/main.c
parent99b1c689eef2b459350189ebac9c2b3214d37ce9 (diff)
Première version de taz FSM.
Diffstat (limited to 'n/asserv/src/main.c')
-rw-r--r--n/asserv/src/main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/n/asserv/src/main.c b/n/asserv/src/main.c
index e6fb72b..9eeca45 100644
--- a/n/asserv/src/main.c
+++ b/n/asserv/src/main.c
@@ -115,6 +115,10 @@ main_loop (void)
if (motor_mode >= 2)
{
goto_update ();
+ if (goto_finish)
+ {
+ proto_send0 ('F');
+ }
}
motor_timer_2 = timer_read ();
/* Speed control. */
@@ -198,6 +202,7 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
if (goto_sign) goto_d = -goto_d;
goto_x = postrack_x;
goto_y = postrack_y;
+ goto_finish = 0;
break;
case c ('a', 1):
/* Angular move.
@@ -205,6 +210,7 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
motor_mode = 2;
goto_mode = 1;
goto_a = args[0];
+ goto_finish = 0;
break;
case c ('g', 8):
/* Go to position move.
@@ -214,6 +220,7 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
goto_mode = 2;
goto_x = v8_to_v32 (args[0], args[1], args[2], args[3]);
goto_y = v8_to_v32 (args[4], args[5], args[6], args[7]);
+ goto_finish = 0;
break;
case c ('f', 1):
/* Fuck the wall move.
@@ -221,6 +228,12 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
motor_mode = 2;
goto_mode = 10;
goto_s = args[0];
+ goto_finish = 0;
+ break;
+ case c ('F', 1):
+ /* Setup finish flag.
+ * - b: new value. */
+ goto_finish = args[0];
break;
case c ('s', 0):
/* Set zero speed (stop). */