summaryrefslogtreecommitdiff
path: root/n
diff options
context:
space:
mode:
authorschodet2005-05-05 13:53:56 +0000
committerschodet2005-05-05 13:53:56 +0000
commit615803f92679bee57e392fec1d88f1cdb06f2f45 (patch)
tree8b422fa4602d71028e8958a487764115ab11c29b /n
parenteebc8595234bd4999b66fbd7b88e040ace900d6a (diff)
Ajout timer.
Diffstat (limited to 'n')
-rw-r--r--n/asserv/src/taz.c26
1 files changed, 13 insertions, 13 deletions
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: