From b37a11a2f303519ffb59e96dd9a853b1945df45b Mon Sep 17 00:00:00 2001 From: schodet Date: Sat, 16 Apr 2005 14:36:22 +0000 Subject: Première version de taz FSM. --- n/asserv/src/main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'n/asserv/src/main.c') 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). */ -- cgit v1.2.3