From f93c8db7b26b7128d779e9b0dcb9239ab3a60459 Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Fri, 22 May 2009 06:00:13 +0200 Subject: * digital/io/src: - do not allow to restart to go to a puck on the ground position when we have already go to the last one. --- digital/io/src/top.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/digital/io/src/top.c b/digital/io/src/top.c index a6ec42ce..7cdeacef 100644 --- a/digital/io/src/top.c +++ b/digital/io/src/top.c @@ -53,12 +53,12 @@ top_get_next_position_to_get_puck_on_the_ground (asserv_position_t *position, }; static uint8_t current_position = 0; - if (restart && current_position != 0) - current_position--; if (current_position >= (sizeof (ground_puck) / sizeof (asserv_position_t))) /* No more position. */ return 0; + else if (restart && current_position != 0) + current_position--; /* Sanity check. */ if (position) { -- cgit v1.2.3