From 615803f92679bee57e392fec1d88f1cdb06f2f45 Mon Sep 17 00:00:00 2001 From: schodet Date: Thu, 5 May 2005 13:53:56 +0000 Subject: Ajout timer. --- n/asserv/src/taz.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'n/asserv') diff --git a/n/asserv/src/taz.c b/n/asserv/src/taz.c index 438c1fe..aa7b9c3 100644 --- a/n/asserv/src/taz.c +++ b/n/asserv/src/taz.c @@ -656,12 +656,24 @@ taz_state_5 (void) } /** FSM. */ -static void +void taz_update (void) { uint8_t old_state, old_substate; old_state = taz_state; old_substate = taz_substate; + /* Game timer. */ + taz_timer++; + if (taz_state && taz_timer > 4 * 90 * taz_1s) + { + taz_state = 0xff; + taz_substate = 0; + speed_restart (); + motor_mode = 0; + pwm_left = 0; + pwm_right = 0; + proto_send2b ('t', 0xff, 0xff); + } /* Max state. */ if (taz_state > taz_max_state || (taz_state == taz_max_state && taz_substate > taz_max_substate)) @@ -672,18 +684,6 @@ taz_update (void) taz_tempo--; return; } - /* Game timer. */ -#if 0 - if (taz_state && taz_timer > 90 * taz_1s) - { - taz_state = 0xff; - taz_substate = 0; - speed_restart (); - motor_mode = 0; - pwm_left = 0; - pwm_right = 0; - } -#endif switch (taz_state) { case 0: -- cgit v1.2.3