From 098917046482fe8a3ef0acf128faa155f448e14c Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Tue, 15 May 2012 22:23:40 +0200 Subject: digital/io-hub/src/guybrush: do not try again if a move is blocked But instead take a new decision. --- digital/io-hub/src/guybrush/move.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'digital') diff --git a/digital/io-hub/src/guybrush/move.c b/digital/io-hub/src/guybrush/move.c index 3c4c7f46..42e78ccc 100644 --- a/digital/io-hub/src/guybrush/move.c +++ b/digital/io-hub/src/guybrush/move.c @@ -39,6 +39,9 @@ #include +/** Number of tries to reach destination. */ +#define MOVE_TRY_AGAIN 1 + /** Move context. */ struct move_t { @@ -80,7 +83,7 @@ move_start (position_t position, uint8_t backward) move_data.final_move = 0; move_data.shorten = 0; /* Reset try counter. */ - move_data.try_again_counter = 3; + move_data.try_again_counter = MOVE_TRY_AGAIN; /* Start the FSM. */ fsm_queue_post_event (FSM_EVENT (AI, move_start)); } @@ -95,7 +98,7 @@ move_start_noangle (vect_t position, uint8_t backward, int16_t shorten) move_data.final_move = 0; move_data.shorten = shorten; /* Reset try counter. */ - move_data.try_again_counter = 3; + move_data.try_again_counter = MOVE_TRY_AGAIN; /* Start the FSM. */ fsm_queue_post_event (FSM_EVENT (AI, move_start)); } -- cgit v1.2.3